May 11, 2024, 06:27:42 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Detect color change in static control.

Started by LarryMc, October 07, 2009, 02:03:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

October 07, 2009, 02:03:48 PM Last Edit: October 07, 2009, 05:24:30 PM by Larry McCaughn
I have a static control whose background is changed to various colors from various locations in the program.

Is there a message that is sent when a static control's background changes?

I can't seem to find one.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

ZeroDog

if the control is not read only, it will send a WM_CTLCOLOREDIT message to the parent window when it is about to be drawn

if the control is read only, it will send a WM_CTLCOLORSTATIC message to the parent window when it is about to be drawn.

LarryMc

Found those; they tell me before it is updated

I needed something to tell me it just finished updating.

If I used what you suggested I would always be a 1/2 lap behind.

Thanks anyway.

I've about decided to put in a timer and do a periodic getpixel command.
I know that will do what I want.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

Larry, maybe additional subroutine will do what you need?
sub ControlSetColor(new)
   if onColorChanging(old, new) /*a message to parent window - wm_command or wm_notify*/
     SETCONTROLCOLOR(new)
     onColorChanged(old, new)
   endif
endsub

Then replace all exsisting SETCONTROLCOLOR with ControlSetColor.