Changing Colours of Button

A

Atif Hasan

I want to change the colour of Button on Form when i roll over the mouse or
click the button. is there any coding required for this? please help
 
A

Atif Hasan

--
Atif Hasan


KenSheridan via AccessMonster.com said:
To change the button's ForeColor property from black to red for instance, in
the button's MouseMove event procedure put:

Me.[YourButtonName].ForeColor = vbRed

Add another button to the form and size in so that it is bigger than the
original button. Set its Transparent property to true. Move it so that it
overlies the original button and place it behind the original button using
'Send to Back' on the Format menu. In design view you should now see part of
the second button surrounding the original, but in form view the second
button will be invisible.

In the second button's MouseMove event procedure put:

Me.[YourButtonName].ForeColor = vbBlack


To cater for moving focus to the button with the keyboard, in the original
button's GotFocus event procedure out:

Me.[YourButtonName].ForeColor = vbRed

And in its LostFocus event procedure put:

Me.[YourButtonName].ForeColor = vbBlack


In each case YourButtonName is the name of the original button.

Ken Sheridan
Stafford, England

Atif said:
I want to change the colour of Button on Form when i roll over the mouse or
click the button. is there any coding required for this? please help

--



.
Thanks for your help, i will try it hope it works thanks again
 

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