What control would I use to play music on my form?
What would the code look like? What type of music file would I use?
Printable View
What control would I use to play music on my form?
What would the code look like? What type of music file would I use?
Microsoft Mulrimedia Control, for example(look for components do add it to your toolbar), to play .wav and .mdi files...
For code example, I cannot help right know. Maybe later...
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Here is an example of code
Do not forget the code to close mmc control.
Maybe you can find more information in MSDN
Private Sub Command1_Click()
'type of use you're going to do of mmc
MMControl1.DeviceType = "WaveAudio"
'the file you want to load
MMControl1.FileName = "C:\WINDOWS\alarm.WAV"
'open the file
MMControl1.Command = "Open"
'make it work
MMControl1.Command = "play"
End Sub
Private Sub MMControl1_Done(NotifyCode As Integer)
'event triggered at end
'close control
MMControl1.Command = "Close"
'clear filename
MMControl1.FileName = ""
End Sub
Best regards
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.