?
Solved

How to change the color of Command Button

Posted on 2003-03-31
7
Medium Priority
?
156 Views
Last Modified: 2010-04-07
I want to change the color of command button ,if i click on it .
How can I do this ?
0
Comment
Question by:Irina_dusha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Accepted Solution

by:
DrTech earned 100 total points
ID: 8238096
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
 
LVL 14

Expert Comment

by:puranik_p
ID: 8238120
make the style property to 1 - Graphical
and..
Private Sub Command1_Click()
    Command1.BackColor = RGB(128, 128, 0)
End Sub
0
 

Expert Comment

by:cjalmeida
ID: 8238158
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:DrTech
ID: 8238204
Now 3 people have suggested the same. Lets see how many we can get!
0
 

Expert Comment

by:khushboo
ID: 8238465
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
 
LVL 6

Expert Comment

by:DrTech
ID: 8238948
YES! Now 4 identical solutions!
0
 

Author Comment

by:Irina_dusha
ID: 8239235
to DrTech ,
don't worry you will get the points.
But thanks to all of you !
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question