iam在媒体播放器中工作,我自己的代码中的所有东西都在工作但如果我按下静音图片框静音并重新打开另一个视频或音乐文件,声音正在播放,并且静音图片框中的标志显示我是静音模式 这是静音图片框的代码:
Private Sub Volume_PictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Volume_PictureBox.Click
Try
If MuteBol = False Then
AxWindowsMediaPlayer1.settings.mute = True
MuteBol = True
Volume_PictureBox.Image = My.Resources.Muted_Volume_Hover'mute picture
MuteToolStripMenuItem.Checked = True
Me.ToolTip1.SetToolTip(Volume_PictureBox, "UnMute")
ElseIf MuteBol = True Then
AxWindowsMediaPlayer1.settings.mute = False
MuteBol = False
Volume_PictureBox.Image = My.Resources.Volume_Hover'un-mute picture
MuteToolStripMenuItem.Checked = False
Me.ToolTip1.SetToolTip(Volume_PictureBox, "Mute")
End If
Catch ex As Exception
MessageBox.Show(ex.Message & ex.Source)
End Try
End Sub
答案 0 :(得分:0)
不要回答Hans的问题,但是如果您已经选择了静音,那么如果您需要将新打开的歌曲静音,那么您只需要一些简单的内容,例如:
If [a new song is opened or the current file changes or something like this]
If MuteBol = True Then AxWindowsMediaPlayer1.settings.mute = True
End If
看起来很简单,除非这不是你想要的。希望这有效!