Change captions in the buttons.

  • Thread starter Thread starter Jose Perdigao
  • Start date Start date
J

Jose Perdigao

I created a mainmenu where I have 16 buttons.
By default in all buttons the following properties:
font name: Wingdings
caption: l
size: 10
color: 16711680

So, on mouse move, I want to change the properties to
font name: Wingdings
caption: l
size: 16
color: 4194432

When the mouse is out of the button I woult like back for the origina
properties.

I devolped the following procedure:

Private Sub Option1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me!Option1.FontSize = 20
Me!Option1.ForeColor = 4194432
End Sub

But when the mouse is out of the button, the last properties still the.

How can I do buttons back to original properties?

Any suggestions?
Thanks,
José Perdigão
 
There are a couple of ways you can do this. The easiest would be to use the
mousemove event of the section of the form the controls are in. Another is
to put a rectangle control around each command button and use the same
technique. Another way would be to use the form timer event and display the
change for a predetermined time, sort of like how tool tips work.
 
I would like to use mousemove envent but I need to know when it is out of
the botton or rectangle.
Do you know how can i do?
Thanks
José Perdigão
 
You will not know when the moves moves away from a control or into a control.
The move move event fires whenever the mouse move over the control. For
example, if you move the mouse over the control and stop, it fires. When you
start moving, it fires again. In fact, it can fire multiple times while the
mouse is over the control.
 
Back
Top