i have context menus & want the menu items font style to change to bold whenever the mouse moves over, and return to regular when it leaves.

Private Sub EmnuExitMenu_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles EmnuExitMenu.MouseLeave
        Me.EmnuExitMenu.Font = New Font(Me.EmnuExitMenu.Font, FontStyle.Regular)
    End Sub

    Private Sub EmnuExitMenu_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles EmnuExitMenu.MouseMove
        Me.EmnuExitMenu.Font = New Font(Me.EmnuExitMenu.Font, FontStyle.Bold)
    End Sub

work fine, however
is there a way to define this globaly for all menus through out the entire applications.

Recommended Answers

All 2 Replies

Here is a common event handler,

.....
Private Sub EmnuExitMenu_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles EmnuExitMenu.MouseMove, EmnuOne.MouseMove, EmnuTwo.MouseMove
        Dim mnu As ToolStripMenuItem = CType(sender, ToolStripMenuItem)
        mnu.Font = New Font(mnu.Font, FontStyle.Bold)
End Sub
....

i see, thank you very much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.