how do I change attributes of a control within the program

Started by raymw, January 25, 2017, 07:27:45 PM

Previous topic - Next topic

raymw

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

Paul Squires

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.


Paul Squires
PlanetSquires Software

raymw

thanks. so far, so good, at least with color change of text boxes