Change captions in the buttons.

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
 
K

Klatuu

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.
 
J

Jose Perdigao

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
 
K

Klatuu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top