Znam da je moguce da se pusti muzika kroz AxMediaPlayer,ali ne znam kako.Moze li neko da mi detaljno objasni.Unapred hvala.
Dopuna: 12 Sep 2005 19:58
Uspeo sam.Evo koda za sve koji su imali problema sa ovim
Kod:
First, open the Toolbox, right-click, and select Add/Remove Items.
Select the Windows Media Player control located at Msdxm.ocx.
Add a Windows Media Player control to the form. This example makes the
control invisible and then controls it with code.
When the user clicks the Play button, the program disables the button.
It sets the Media Player control's FileName property to the name of the
file to play and then calls its Play method.
When the control finishes playing the file, it raises its EndOfStream
event and hte program re-enables the Play button.
Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPlay.Click
btnPlay.Enabled = False
Application.DoEvents()
Dim file_name As String = Application.StartupPath
file_name = file_name.Substring(0, file_name.Length - 3)
AxMediaPlayer1.AutoStart = False
AxMediaPlayer1.FileName = file_name & "Test.wav"
AxMediaPlayer1.Play()-ovu liniju mozete da obrisete
End Sub
Private Sub AxMediaPlayer1_EndOfStream(ByVal sender As Object, ByVal e
As AxMediaPlayer._MediaPlayerEvents_EndOfStreamEvent) Handles
AxMediaPlayer1.EndOfStream
btnPlay.Enabled = True
End Sub
|