I'm looking for the simplest and cleanest way of having 10 buttons on
a form, on which if I move my mouse over, a label's text changes as
specified.
I'm using Visual Basic .NET and I'm not too familiar with its
intricacies, so I'm getting a bunch of errors on certain scenarios.
The code below works fine but breaks if I click on Button1 a few times
without moving the program window
----------
Private Sub Button1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Button1.MouseMove
Dim x = System.Windows.Forms.Control.MousePosition.X()
Dim y = System.Windows.Forms.Control.MousePosition.Y()
Dim tF1x = Form1.ActiveForm.Left()
Dim tF1y = Form1.ActiveForm.Top()
If (tF1x + Button1.Location.Y() < x And x < tF1x +
Button1.Location.X() + Button1.Size.Width()) Then
' If (tF1y + Button1.Location.Y() < y And y < tF1y +
Button1.Location.Y() + Button1.Size.Height()) Then
Label1.Text = Button1Text
' End If
End If
End Sub