R
Rob W
Greetings,
I have an event that is run any time the mouse enters any of the menus and
tools strips items.
I had to pain stakingly select from a list of 30 odd items to complete the
handles clause (see code at bottom of post).
Is there a way they could be added dynamically (I am aware event handlers
can)?
Thanks
Rob
(code below)
Private Sub updateStatusLabelMenuSelection(ByVal sender As System.Object,
ByVal e As System.EventArgs) _
Handles NewCtrlNToolStripMenuItem.MouseEnter,
CopyToolStripMenuItem.MouseEnter, CutToolStripMenuItem.MouseEnter, _
DeleteToolStripMenuItem.MouseEnter, EditToolStripMenuItem.MouseEnter,
ExitAltF4ToolStripMenuItem.MouseEnter, _
HelpToolStripMenuItem.MouseEnter, NewCtrlNToolStripMenuItem.MouseEnter,
NewToolStripButton.MouseEnter, _
OpenCtrlOToolStripMenuItem.MouseEnter, OpenToolStripButton.MouseEnter,
PasteToolStripButton.MouseEnter, _
PasteToolStripMenuItem.MouseEnter, SaveAsToolStripMenuItem.MouseEnter,
SaveCtrlSToolStripMenuItem.MouseEnter, _
SaveToolStripButton.MouseEnter, SelectAllToolStripMenuItem.MouseEnter,
SetBackgroundColorToolStripMenuItem.MouseEnter, _
SetFontColorToolStripMenuItem.MouseEnter,
SetFontToolStripMenuItem.MouseEnter, TimeDateToolStripMenuItem.MouseEnter, _
UndoToolStripMenuItem.MouseEnter, WordWrapToolStripMenuItem.MouseEnter,
CopyToolStripButton.MouseEnter, _
AboutMyNotePadToolStripMenuItem.MouseEnter
'Set status text using tooltip property value by identifying the sender
object
If TypeOf sender Is ToolStripMenuItem Then
Me.ToolStripStatusLabel1.Text = DirectCast(sender,
ToolStripMenuItem).ToolTipText
ElseIf TypeOf sender Is ToolStripButton Then
Me.ToolStripStatusLabel1.Text = DirectCast(sender,
ToolStripButton).ToolTipText
End If
End Sub
I have an event that is run any time the mouse enters any of the menus and
tools strips items.
I had to pain stakingly select from a list of 30 odd items to complete the
handles clause (see code at bottom of post).
Is there a way they could be added dynamically (I am aware event handlers
can)?
Thanks
Rob
(code below)
Private Sub updateStatusLabelMenuSelection(ByVal sender As System.Object,
ByVal e As System.EventArgs) _
Handles NewCtrlNToolStripMenuItem.MouseEnter,
CopyToolStripMenuItem.MouseEnter, CutToolStripMenuItem.MouseEnter, _
DeleteToolStripMenuItem.MouseEnter, EditToolStripMenuItem.MouseEnter,
ExitAltF4ToolStripMenuItem.MouseEnter, _
HelpToolStripMenuItem.MouseEnter, NewCtrlNToolStripMenuItem.MouseEnter,
NewToolStripButton.MouseEnter, _
OpenCtrlOToolStripMenuItem.MouseEnter, OpenToolStripButton.MouseEnter,
PasteToolStripButton.MouseEnter, _
PasteToolStripMenuItem.MouseEnter, SaveAsToolStripMenuItem.MouseEnter,
SaveCtrlSToolStripMenuItem.MouseEnter, _
SaveToolStripButton.MouseEnter, SelectAllToolStripMenuItem.MouseEnter,
SetBackgroundColorToolStripMenuItem.MouseEnter, _
SetFontColorToolStripMenuItem.MouseEnter,
SetFontToolStripMenuItem.MouseEnter, TimeDateToolStripMenuItem.MouseEnter, _
UndoToolStripMenuItem.MouseEnter, WordWrapToolStripMenuItem.MouseEnter,
CopyToolStripButton.MouseEnter, _
AboutMyNotePadToolStripMenuItem.MouseEnter
'Set status text using tooltip property value by identifying the sender
object
If TypeOf sender Is ToolStripMenuItem Then
Me.ToolStripStatusLabel1.Text = DirectCast(sender,
ToolStripMenuItem).ToolTipText
ElseIf TypeOf sender Is ToolStripButton Then
Me.ToolStripStatusLabel1.Text = DirectCast(sender,
ToolStripButton).ToolTipText
End If
End Sub