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

Change Fore/BackColor of a Command Button

Status
Not open for further replies.

DirkVFP

Programmer
Aug 25, 2005
57
NL
Looking around the properties of the CommandButton class, I could not find any way to modify the fore- and backcolor of a command button. Now I'm wondering how to do it and why there are no fore- and backcolor properties to customize ones command button?

(I'm using VFP7 btw, maybe MS has put it in future versions?)
 
I can understand the point of view from MS to make things user customizeable, but my target 'audience' does not change these settings. Am I still able to change those colors (via workarounds) or do I have to wait untill we purchase VFP8 or higher?
 

Dirk,

No, you can't change them in VFP 7.0. The usual workaround is to create a graphic file that contains the button caption and the combination of colours that you want, and display this in place of the caption (i.e. in the button's Picture property).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mike,

I already thought of that, but that would be just too much work. So I'm going to keep the default colors.

Dirk
 
Lookt at FAQ184-3534

It's in the generald coding issues FAQ, no wonder I couldn't find it :) Thank, this will certainly do for now.
 
Whether or not your users generally leave teh color settings alone, keep in mind that sooner or later, you may have a user with visual issues who uses the Windows settings to make things visible for himself. If you're messing with colors in the application, then you're running the risk of making your application unusable for some people.

If you must specify colors, do it by reading the user's Windows settings and working with those colors.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top