ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to change color of buttons if pressed? (https://www.excelbanter.com/excel-programming/285074-how-change-color-buttons-if-pressed.html)

Phillips

How to change color of buttons if pressed?
 
How can I change the color of certain buttons if they get pressed?
I would "like" to use color NAMES (RED, GREEN, BLUE, BROWN etc)

I have tried to declare the name as public in my declarations, and then
assing a RGB value (like RED= "255,0,0") but this is the wrong type

Also, when I move to the NEXT record, I would like to reset the colors of
the buttons

I have gotten the original color to set with .commandbuttonxx.background =
RGB(125, 125,125), and I can change it when I press the button, but I can
not figure out where and what to put it in order to "RESTORE" when I move
from record to record. If I put it where I refresh my .textboxes , I get an
error:
Compile Error: Method or data member not found (this is with out the . in
front) and if I do have the period in frount, I get a compile error: Invalid
or unqualified reference


Thanks
Phil




Phillips

How to change color of buttons if pressed?
 
DOH!!!

..commandbuttonxx.background should have been .commandbuttonxx.backcolor
.....

Thanks
Phil


"Phillips" wrote in message
news:J_MBb.502919$Fm2.482326@attbi_s04...
How can I change the color of certain buttons if they get pressed?
I would "like" to use color NAMES (RED, GREEN, BLUE, BROWN etc)

I have tried to declare the name as public in my declarations, and then
assing a RGB value (like RED= "255,0,0") but this is the wrong type

Also, when I move to the NEXT record, I would like to reset the colors of
the buttons

I have gotten the original color to set with .commandbuttonxx.background =
RGB(125, 125,125), and I can change it when I press the button, but I can
not figure out where and what to put it in order to "RESTORE" when I move
from record to record. If I put it where I refresh my .textboxes , I get

an
error:
Compile Error: Method or data member not found (this is with out the . in
front) and if I do have the period in frount, I get a compile error:

Invalid
or unqualified reference


Thanks
Phil







All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com