Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embarassing Question

Status
Not open for further replies.

BRADLEY21

Programmer
Sep 19, 2002
35
US
I am killing myself trying to change the color of the command button in my form. I have read all of the FAQ and countless pages help documentation.

I want to make my command button white.

any help would be apreciated
 
The command button takes its colors from the Windows default colors. That is, except for the text on the button. You could always add a white bitmap to the button.
Another thing you could do is create your own class using a shape with a label in it and perform functions in the click event of the shape.
Dave S.
 
ejd

The only way I can think of is to create a colored bitmap, and use that in the picture property. You may need to add text to the bitmap if you need text on it. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Hi ejd..

1. You cannot directly change the command buttons back color.

2. There is a work around worth thinking, if the events you need to process are available for the text box.
Fox example..
a. Drop a text box in your form.
b. Set its properties as given below..
Name = "Add"
DisabledBackColor = RGB(255,255,128) && yellow
** you can set it to what ever you want.
ReadOnly = .t.
c. In the click event of the Text box put your click event code.
d. In the KeyPressEvent of the Text box.. add the code..
This.Click()
But this is not helping you with hot keys. As i mentioned lot of limitations .. but if the requirement is small go ahead....

3. However.. the correct approach will be to RollOut your own Jpg or BMP and use that in the Picture class of the command Button. If you want an Example.. provide me your email. I will send one sample BMP whcih you can put in your command Button as the picture property and view the form..

Hope this helps you :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top