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

Command Button Back Color 2

Status
Not open for further replies.

FoxEgg

Programmer
Mar 24, 2002
749
0
16
AU
I must be losing it....

I can find no BACKCOLOR for command buttons.
Screen has colorsource and color scheme BUT NO BACK COLOR.


Form is blue --->

BACKCOLOR property set to (0, 100, 255)

Where do I set it for a command button ?

Thanks

John
 
FoxEgg

And I used Mike's code which works well ... and I used FAQ184-1791 but I still cannot find an API instruction which changes the background color...

The SetSysColorsis the function that changes to colors.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Sorry Mike,

I used your code (above) which worked brilliantly and changed the WINDOWFRAME color as you specified... I then changed


lpSysColor = COLOR_WINDOWFRAME to

lpSysColor = COLOR_WINDOW

and the whole screen (or window) changed to blue ...

what I want is JUST the grey background of JUST the command button to go BLUE...

I understand that the SetSysColors is the function that changes to colors but what is the correct parameter to replace color_windowframe in this line of your code...

lnSavedColor = GetSysColor (COLOR_WINDOWFRAME)

so I can just change the background color of the command button.


I'll keep lookin'

John
 
FoxEgg

It seems I cannot find a way to change just the color of the command button. The API calls seem to affect all windows (Like the windows themes do.). There are a lot of "colored" buttons activex on the net that you could use, but they mostly seem to use either bitmaps or skins.
Mike Gagnon

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

I too found that if I set the syscolor to 15 that sets all the windows buttons as you said....

I must confess that I am perplexed that VFP which purports to give the programmer all the control options has this as a limitation !!!

Like Rick said... it seems to be 'fixed' inthe VFP8... but for now it looks like The Maniac's solution is the simplest... and doesn't change all the system settings... altho' I have had a little difficulty getting the Label to print exactly where I want.. But I'll work that out.

Thanks to all for all your efforts.

John Fox


(I did create a procedure to set the syscolor with half of your code and then another procedure to restore the color with the other half of your code... but, as all the entire screen and buttons change it looks WEIRD)

(and the good news is I DON'T need to learn API calls !!! Yeaaa )
 
FoxEgg

(and the good news is I DON'T need to learn API calls !!! Yeaaa )

Reserve that for another lifetime.

I must confess that I am perplexed that VFP which purports to give the programmer all the control options has this as a limitation !!!

I'm from the old school of thought, that "like most software available on the market these days", the interface "should" blend in so as not to deter from the task at hand.
It's a bit like one of my programmers once said to me: "Boss, look at this fantastic interface!!!", and I said "yeah, but does it work?".
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
L'espirit de d'escalier

Why can't I just use the Click Event in a Label ???

I tested it ... seems to work...

JF
 
John

L'espirit de d'escalier

L'esprit de l'elevateur? (Were are modern here...)

Four months later?
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
L'espirit de Tek-Tips Corps...

Four months later?

"Time is an illusion... lunchtime doubly so..."

I like my Label style "Command Buttons"

JF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top