I have a menu bar like this.
Menu
.Item1
.Item2
.Item3
I need to use them like radio buttons. So i have come up with this. Seems a nasty hack since it loops all my menu items. And if i later add different checks it would interfear.
Any better solutions?
vb Code:
Private Sub mnuMainMenuToolBarComposeExistingThread_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles mnuMainMenuToolBarPrivateMessage.Click, mnuMainMenuToolBarComposeExistingThread.Click, _ mnuMainMenuToolBarComposeNewThread.Click For Each ctrl As ToolStripMenuItem In mnuMainMenuToolBar.Items If Not ctrl.Name = DirectCast(sender, ToolStripMenuItem).Name Then CType(ctrl, ToolStripMenuItem).Checked = False End If Next ctrl End Sub
(edit just realized this rewritten version is not even working)




Reply With Quote