Did you intend to call Button_Hover from your final Handles-enabled routine,
or was that just a typo?
-----
Tim Patrick -
www.timaki.com
Start-to-Finish Visual Basic 2005
> I have a VS 2005 VB.NET project and would like to change the color of
> the textbox when the user hovers over it. In a Module I have the
> following routines:
>
> Public Sub Button_Hover(ByRef btnName As Button)
>
> btnName.BackColor = Color.BlanchedAlmond
>
> End Sub
>
> Public Sub Button_Leave(ByRef btnName As Button)
>
> btnName.BackColor = Color.Transparent
>
> End Sub
>
> ----------------------------------------------
>
> I called the routines from the following code:
>
> Private Sub cmdTierCancel_MouseHover(ByVal sender As Object, ByVal e
> As System.EventArgs) Handles cmdTierCancel.MouseHover
>
> Button_Hover(cmdTierCancel)
>
> End Sub
>
> Private Sub cmdTierCancel_MouseLeave(ByVal sender As Object, ByVal e
> As System.EventArgs) Handles cmdTierCancel.MouseLeave
>
> Button_Leave(cmdTierCancel)
>
> End Sub
>
> ---------------------------------
>
> SO FAR SO GOOD. I thought it would be nice to use the Handles feature
> and call the routine like this:
>
> ---------------------------------
>
> Public Sub Handles_All_Buttons Handles(ByVal sender As Object, ByVal e
> As System.EventArgs) cmd1.MouseHover, cmd2.MouseHover,
> cmd3.MouseHover
>
> Button_Leave(sender)
>
> End Sub
>
> But this routine doesn't work. Can anyone tell me what I am doing
> wrong?
>
> Thanks
>