PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: raymw on January 25, 2017, 07:27:45 PM

Title: how do I change attributes of a control within the program
Post by: raymw on January 25, 2017, 07:27:45 PM
How do I change a control within the program, e.g. change background colour and size of textbox, say, from the original design. Can anyone point me towards an example, or prepared to write a code snippet and explain. Thanks

Best wishes,
Ray
Title: Re: how do I change attributes of a control within the program
Post by: Paul Squires on January 25, 2017, 10:48:57 PM
Some controls allow you to change the coloring on the fly but others do not easily (for example, Common Controls and Command/Push Buttons). For many of the standard basic Window controls (Labels, TextBoxes), you can use the FF_Control_SetColor function passing it RGB color values for foreground and background. For example,

   FF_Control_SetColor( HWND_FORM1_A, BGR(255,255,255), BGR(100,100,100) )

Notice that in FreeBasic the function is not called RGB but rather BGR.

To change control sizes you can use the FireFly function: FF_Control_SetSize
...or, use the WinAPI functions SetWindowPos or MoveWindow.


Title: Re: how do I change attributes of a control within the program
Post by: raymw on January 26, 2017, 01:21:08 PM
thanks. so far, so good, at least with color change of text boxes