Mouseovers

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hello.

Is it possible to do mouseover buttons on a form and if
so, how?

Thanks in advance,

m.
 
Mike said:
Hello.

Is it possible to do mouseover buttons on a form and if
so, how?

Thanks in advance,

Yes. You can use a label control instead of a command button. In the
label's MouseMove event, set its SpecialEffect property to Raised, and
in the MouseMove event of the surrounding form section, set it back to
Flat. Like this:

'----- start of example code -----
Private Sub lblMouseOver_MouseMove( _
Button As Integer, _
Shift As Integer, X As Single, _
Y As Single)

With Me.lblMouseOver
If .SpecialEffect = 0 Then .SpecialEffect = 1
End With

End Sub

Private Sub Detail_MouseMove( _

Button As Integer, _
Shift As Integer, X As Single, _
Y As Single)

With Me.lblMouseOver
If .SpecialEffect = 1 Then .SpecialEffect = 0
End With

End Sub
'----- end of code -----

You have to be careful about putting the "buttons" too close to each
other or to the edge of the form, or else the Detail section's MouseMove
event may not get a chance to fire on rapid mouse movements.
 
Back
Top