Page 1 of 1

Posted: Sat Dec 22, 2001 4:53 pm
by BackupUser
Restored from previous forum. Originally posted by Cantor.

Hi!

Is there a way to change the color (i. e. foreground and background) of a gadget?
The colours of my application are not quite correct under Win XP. The "Textgadget" is drawn with a grey (from Win 98/ME) background instead of white (from Win XP/modern design). Or are the gadget commands to be updated for Win XP?



--
Best regards,
Martin

Posted: Sun Dec 23, 2001 11:42 pm
by BackupUser
Restored from previous forum. Originally posted by Shagwana.

I would be intrested in know this also, so is there anyone out there with a few moments to spare to help a couple of newbies?. What i am after is a way to change the background colours of existing gadgets

http://www.sublimegames.com

Posted: Mon Dec 24, 2001 12:23 am
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

I've been looking the documentation about the matter. The reason I haven't replied to this question is that I don't know the answer. Anyway, it seems that the method to change colors would difer from one gadget to another, and it would be more easily achievable if it's made before gadget creation, probably with SetClassLong_(). But the fact is, as I said, that I haven't had any success with it, sorry.

Bye,

El_Choni

Posted: Mon Dec 24, 2001 1:30 am
by BackupUser
Restored from previous forum. Originally posted by Franco.

Why try to change the color of the gadgets?
Change the color of your Window automaticly with:

Code: Select all

Procedure ColorizeWindow(Color)
  Brush.LOGBRUSH\lbColor = GetSysColor_(Color)
  SetClassLong_(WindowID(),#GCL_HBRBACKGROUND,CreateBrushIndirect_(Brush))
  RedrawWindow_(WindowID(),0,0,7)
EndProcedure
 
;..... more code
 
OpenWindow(........
 
ColorizeWindow(#COLOR_BTNFACE) ;<- same color as textgadgets or buttons...
Hope this helps.

Have a nice day...
Franco

Edited by - franco on 24 December 2001 01:56:24