You can create various multimedia applications in Visual Basic that can play audio CD, audiofiles, DVD , video files and more.
To be able to play multimedia files or multimedia devices, you have to insert Microsoft Multimedia Control into your VB application that you are going to create. However, Microsoft Multimedia Control is not normally included in the startup toolbox, therefore you need to add the MM control by pressing Ctrl+T and select it from the components dialog box that is displayed.
In this program, you can create a CD player that resembles an actual CD player. It allows the user select a track to play, to fast forward, to rewind and also to eject the CD. It can also display the track being played. The interface and code are shown below.
a) The Interface.
Private Sub Form_Load()
'To position the page at the center
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
'Initialize the CD
myCD.Command = "Open"
Private Sub myCD_StatusUpdate()
'Update the track number
trackNum.Caption = myCD.Track
Private Sub Next_Click()
myCD.Command = "Next"
Private Sub Play_Click()
myCD.Command = "Play"
Private Sub Previous_Click()
myCD.Command = "Prev"
Private Sub Stop_Click()
myCD.Command = "Stop"
Copyright ® 2008 Dr.Liew Voon Kiong . All rights reserved |Contact: email@example.com