Can I change th color of a gadget?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
Post Reply