首先定义一个方法:
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
原文地址:https://www.cnblogs.com/Juli/p/11535307.html
时间: 2024-11-13 00:33:07