BlueRaja的回答就是答案,你可以這樣做多種方式,這裏有二:
首先:
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
ToolStripButton2.Checked = ToolStripButton1.Checked
'Do whatever you want with your buttons
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
ToolStripButton1.Checked = ToolStripButton2.Checked
'Do whatever you want with your buttons
End Sub
另一種方法:
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
'Do whatever you want with your buttons
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
'Do whatever you want with your buttons
End Sub
Private Sub ToolStripButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.CheckedChanged
ToolStripButton2.Checked = ToolStripButton1.Checked
End Sub
Private Sub ToolStripButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.CheckedChanged
ToolStripButton1.Checked = ToolStripButton2.Checked
End Sub
我喜歡顯然是第一個。
通常這是通過一個`ToolStripMenuItem`來完成的,它設置了`CheckOnClick = true`。這不符合你的需求嗎? – 2011-01-07 23:37:43