0

我有一个作为学校项目的一部分制作的媒体播放器。我有一个按钮,按下时会隐藏表单并显示另一个。我想要做的是让按钮也停止播放媒体文件。这是我的代码

Private Sub TxtName_Enter(ByVal sender As System.Object, ByVal e As FormClosingEventArgs) Handles MyBase.FormClosing
        e.Cancel = True
    End Sub

    Private Sub BtnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBrowse.Click
        With OpenFileDialog1
            .Title = "File Browser"
            .Filter = "Media Files (*.wmv;*.mp3)|*.wmv;*.mp3"
            .FileName = ""
            .CheckFileExists = True
        End With
        If OpenFileDialog1.ShowDialog = _
            Windows.Forms.DialogResult.OK Then
            AxWindowsMediaPlayer1.URL = _
            OpenFileDialog1.FileName
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBack.Click
        Me.Hide()
        ECoach.Show()
4

1 回答 1

0

要开始/停止...您必须使用MediaPlayerCtrl.Ctlcontrols.OrderYouWish. 那是:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBack.Click
     AxWindowsMediaPlayer1.Ctlcontrols.stop()
     Me.Hide()
     ECoach.Show()
 End Sub
于 2013-09-07T08:00:19.983 回答