|
-
Oct 27th, 2002, 07:01 AM
#1
Thread Starter
Frenzied Member
Ok, got it.
Started with frmMain and for testing, added two command buttons to it.
Added "Project/ Components/ Windows Media Player" to the tool bar,
then added Mediaplayer to a 2nd form - frmSound.
And then put this code in the respective forms.
-------------
' in frmMain
Private Sub cmdPlay_Click()
Load frmSound
frmSound.Play ("My.wav")' You'll need to add the path if your .wav isn't in the same folder as the program
End Sub
Private Sub cmdStop_Click()
frmSound.MediaPlayer1.Stop
Unload frmSound
End Sub
---------
'in frmSound
Public Sub Play(filename)
On Error Resume Next
If filename <> "" Then
With MediaPlayer1
.AutoStart = True
.filename = filename
.Play
End With
End If
End Sub
---------
It feels like playing "Mary Had a little Lamb" on a pipe organ, but it WORKS!
I wonder how many ppl have writen alarms that can play DVDs on the side : )
But it will play over a game.
Thanks for all your help guys!
Last edited by longwolf; Oct 27th, 2002 at 07:05 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|