VB.NET... not C please. I have made a menu with dynamically created buttons consisting of a total of 18 buttons. I have need to change the background of any button when the mouse hover/mouseover event occurs but am at a loss as to how to add this feature.
My current code is as follows:
Dim btnBilling As New ToolStripButton
With btnBilling
'Set properties
.BackgroundImage = My.Resources.ToolBarBkGrd2
.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
.TextImageRelation = TextImageRelation.ImageBeforeText
.Image = My.Resources.Billing
.Font = New Font("Calibri", 8.25, FontStyle.Bold)
.Text = "Billing" & vbNewLine & "Info"
End With
'Create Handle to Click Event
AddHandler btnBilling.Click, AddressOf BtnBilling_Click
'Add button to toolstrip
ToolStrip1.Items.Add(btnBilling)
'Billing Button Events
Private Sub BtnBilling_Click(sender As Object, e As EventArgs)
Bill()
End Sub
Public Sub Bill()
If ActiveMdiChild IsNot Nothing Then ActiveMdiChild.Close()
Billing.MdiParent = Me
Billing.Show()
End Sub
How and where would I add the mouse hover event handler. The only mouse hover event, planned for right now, would be to change the background image to My.Resources.ToolBarBkGrd3
The menu is on a PARENT form that stays visible at all times. Only the current child form closes and loads in the new child form.