<Previous Lesson> <<Home>> < Next Lesson>
You can create various multimedia applications in VB that could play audio CD, audiofiles, VCD , video files and more.
19.1 Creating a CD player
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. ![]() |
The Code
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"End Sub
Private Sub myCD_StatusUpdate()
'Update the track number
trackNum.Caption = myCD.Track
End Sub
Private Sub Next_Click()
myCD.Command = "Next"
End Sub
Private Sub Play_Click()
myCD.Command = "Play"End Sub
Private Sub Previous_Click()
myCD.Command = "Prev"
End SubPrivate Sub Stop_Click()
myCD.Command = "Stop"
End Sub
<Previous Lesson> <<Home>> < Next Lesson>
Copyright ® 2008 Dr.Liew Voon Kiong . All rights reserved |Contact: admin@vbtutor.net