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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I change the colour of Option buttons?

Status
Not open for further replies.

MitchUK

Programmer
Jan 17, 2001
22
GB
I have a number of option buttons that I would like to change the colour of, I have tried changing the backcolor property to no avail and would like some help.

Do I need to create a new colorscheme and colorsource and if so, how is it done?

Find Help and Online help about as useful as a lecture in astrophysics when you need to change a tyre.

Waiting delivery of "hacker's guide to foxpro", help in the meantime greatly appreciated as usual. Have knowledge, lack patience.
MitchBsc@yahoo.co.uk
 
MitchUK

It may be you are trying to change the container's fore/backcolor properties?

Code should be:-

THISFORM.Optiongroup1.Option1.ForeColor = RGB(255,0,0)
THISFORM.Optiongroup1.Option1.BackColor = RGB(255,255,255)

Hope this eases the pain!

Chris :)
 
Chris,

Nice try but no cigar. That code only changes the text in the button. I want to change to actual colour of the button (currently set to grey (192,192,192 ???)

Thanx anyway Have knowledge, lack patience.
MitchBsc@yahoo.co.uk
 
Actually, I think you can't direct change the back color of buttons. But you can add an image, and have the background of the image whatever color you want. I'm too new at VFB (vs VB) to remember the details of whether you have to include the text you want to appear in the image, or whether you can make the text with a transparent background and posiion the one on top of the other. That would be the intelligent way to make things work, but I seem to remember seeing something about it not being possible. --Dave
 
Mitch,
Just to make sure there isn't a "language" difference, are you speaking of the graphical version of an option button in an option group? (formerly refered to as radio buttons) Or are you speaking of changing the background color of a command (push) button? If the later, you can't. You can simulate colored buttons with a shape, a container (even put a command button in a container), or use a 3rd party ActiveX control to provide this functionality.

Rick
 
Here, goes.

ChrisRChamberlain - no problem.

DEDMOD - I usually use images nowadays instead of buttons as they look better from a design point of view, but this package I'm working on was inherited so there would be too much coding involved to change now. Furthermore, I need to change the text in the buttons (using the caption property) depending on what is going on at what time within the application (so images are out).

RGBEAN - Yep, using the old radio buttons. but backgolour and forecolour properties don't reach the required affect. It is the actual colour of the button I want to change!

Have i left anything out??? Have knowledge, lack patience.
MitchBsc@yahoo.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top