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

Command Button Color 1

Status
Not open for further replies.

LuRSH

Programmer
Aug 2, 2001
63
US
Hi Folks!

I know this is not a new issue but I didn't find any answer yet...

In an application I'm developing there are (naturally) many command and toggle buttons. The problem is depending on the default Windows color sometimes the "fore color" I defined for those buttons is the same as the background color, meaning that it's impossible to see the caption on those buttons.

I don't want to establish a pallet for the application, once different users have different "taste" for colors, so I would prefer to let then use their own Windows color.

For what I've heard I can't change the buttons background color but I wonder if is there a way to know which color is set for that background? This would help because once I knew the background color It would be possible to "shift" the foreground color so they would not match...

Thanks in advance...
 
Command buttons are not that flexible so an alternative could be to use a Rectangle rather than a command button. Set the BackStyle to Normal, the SpecialEffect to Raised, and the forecolour to something more unusual - the OnClick event is still available. It looks similar but you do loose the look of the button when it is clicked. To overcome this have a flat rectangle that is set to invisible that is made visible and then invisible during the event.
 
Hi Winbod,

I used this solution before. It works but it has some drawback and I was hoping to find another kind of solution...

Thanks anyway!
 
Hi!

Check out this web site
You should find a Db called command buttons or something like that which will have code to do what you want.

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top