stopping a media file playing once started in vb.net

jason1987

Member
Joined
Apr 15, 2007
Messages
14
Programming Experience
Beginner
i have the following code:
VB.NET:
Private Sub MainMenuForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim filenames As String = "C:\Documents and Settings\Jason\Desktop\project1\project1\TV Theme - Deal Or No Deal.mp3"
        AxWindowsMediaPlayer1.URL = filenames
        AxWindowsMediaPlayer1.Visible = False
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        highScoreForm.Show()
        Me.Hide()
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        AboutForm.Show()
        Me.Hide()
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        InstructionsForm.Show()
        Me.Hide()
    End Sub
this plays an audio file once the form is loaded, however i want this file to stop playing once i click a certain button for examples sake say button2, how can i do this?
 
VB.NET:
AxWindowsMediaPlayer1.Ctlcontrols.stop()
 
Back
Top