两个完全一个的button,其中一个就是没反应
'播放 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Me.ListView1.SelectedItems.Count < 1 Then
MessageBox.Show("请选择歌曲!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Dim MyPos As Int16 = Me.ListView1.SelectedItems(0).Index
Dim MyFileName As String = Me.ListView1.Items(MyPos).SubItems(3).Text
Me.AxMediaPlayer1.FileName = MyFileName
Me.AxMediaPlayer1.Play()
End Sub
Private Sub btn7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn7.Click
If Me.ListView1.SelectedItems.Count < 1 Then
MessageBox.Show("请选择歌曲!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Dim MyPos As Int16 = Me.ListView1.SelectedItems(0).Index
Dim MyFileName As String = Me.ListView1.Items(MyPos).SubItems(3).Text
Me.AxMediaPlayer1.FileName = MyFileName
Me.AxMediaPlayer1.Play()
End Sub
以上两个Button的代码什么的完全一样。但是btn7 点了就是没反应。音乐不播放,为什么!
困扰我很久。谢谢大家