To create a Windows Media Player by using multimedia control in VB.
Algorithm step by step procedure:
Step 1: Open VB 6.0
Step 2: Select standard.exe and design the window
Step 3: Go to Projects >>Components. A dialog window will be displayed. In that select “Microsoft Multimedia Control” and click ok.
Step 4: Place the control in the window.
Step 5: Write the coding.
Step 6: Build and run the application.
Visual Basic Programming Source Coding :
Form 1
Private Sub Dir1_Change()
File1.Path = Dir1.Path
File2.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Picture1.Picture = LoadPicture(File1.Path + "\" + File1.FileName)
End Sub
Private Sub File2_Click()
MMControl1.Command = "CLOSE"
MMControl1.FileName = File2.Path + "\" + File2.FileName
MMControl1.hWndDisplay = Picture1.hWnd
MMControl1.Command = "OPEN"
End Sub
Private Sub List1_Click()
If List1.Text = "jpg" Then
File1.Pattern = "*" + List1.Text + "*"
File2.Visible = False
File1.Visible = True
End If
End Sub
0 comments:
Post a Comment