Chnage the main form's background color

Started by Nathan Durland, June 13, 2015, 10:29:29 AM

Previous topic - Next topic

Nathan Durland

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.

Wilko Verweij

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

Nathan Durland

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.