首先定义一个方法:
1 Private Sub SingleCheck(ByVal sender As Object) 2 RawDataToolStripMenuItem.Checked = False 3 TransToolStripMenuItem.Checked = False 4 SmoothToolStripMenuItem.Checked = False 5 LineFitToolStripMenuItem1.Checked = False 6 sender.Checked = True 7 End Sub
然后在所有菜单栏的点击事件里面调用该方法,例如:
Private Sub LineFitToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LineFitToolStripMenuItem1.Click
SingleCheck(sender)
End Sub