How to change the color of Command Button

I want to change the color of command button ,if i click on it .
How can I do this ?
Irina_dushaAsked:
Who is Participating?
 
DrTechConnect With a Mentor Commented:
Change the style property of the button to graphical.

Then use the backcolor property to change the color when you like (in you case in the OnClick event)
0
 
puranik_pCommented:
make the style property to 1 - Graphical
and..
Private Sub Command1_Click()
    Command1.BackColor = RGB(128, 128, 0)
End Sub
0
 
cjalmeidaCommented:
1. Create a CommandButton 'Command1'
2. Set it's style property to '1 - Graphical'
3. Write the following code on its Click() event:
 
Private Sub Command1_Click()
   'Set the RGB to the color you want
   Command1.BackColor = RGB(255, 0, 0)
End Sub
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
DrTechCommented:
Now 3 people have suggested the same. Lets see how many we can get!
0
 
khushbooCommented:
One way to change the color of the command button is by changing the Style property in the properties menu to 1-Graphical and than go to BackColor option in the property menu from their click on Palette on the top left and than choose the color of your choose. Let me know if it works
0
 
DrTechCommented:
YES! Now 4 identical solutions!
0
 
Irina_dushaAuthor Commented:
to DrTech ,
don't worry you will get the points.
But thanks to all of you !
0
All Courses

From novice to tech pro — start learning today.