PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Nathan Durland on June 13, 2015, 10:29:29 AM

Title: Chnage the main form's background color
Post by: Nathan Durland on June 13, 2015, 10:29:29 AM
Subject says it all, i think.  I want to programmatically change the background color of my applications main form. FF_CONTROL_SetColor doesn't appear to be the answer.  It's early, and I've not yet had my third cup of Jet Fuel, so my google-fu is failing me.  Any guidance appreciated.
Title: Re: Chnage the main form's background color
Post by: Wilko Verweij on June 14, 2015, 10:04:49 AM
This works for me:
FF_Control_SetColor( hWndForm, -1, Rgb(255,0,0) )
It leaves the foreground color unchanged (-1) and changes the backcolor into red Rgb(255,0,0).

Wilko
Title: Re: Chnage the main form's background color
Post by: Nathan Durland on June 14, 2015, 09:12:09 PM
I tried that and it did not work.  Today I created a new user-defined message (%WM_USER_FORM_RECOLOR) and added some code to the FROM_CUSTOM clock to handle the message.  The code does FF_Control_SetColor on the form, and it works.  The new code also has FF_DoEvents, and I can't remember if I had that in the old code; that may have been the problem all along.  Something else I noticed was that after the form's color is changed, all the labels on the form remained the color that was specified at run time, even though the labels were all set as 'Transparent'.  I do a FF_Control_SetColor on them to the new form color and everything is working like I need it to.