Function Reference


GUICtrlSetStyle

Changes the style of a control.

GUICtrlSetStyle ( controlID, style [, exStyle] )

Parameters

controlID The control identifier (controlID) as returned by a GUICtrlCreate...() function, or -1 for the last created control.
style Defines the style of the control. See GUI Control Styles Appendix.
exStyle [optional] Defines the extended Style of the control. See Extended Style Table.

Return Value

Success: 1.
Failure: 0.

Remarks

Some styles cannot be changed dynamically, check MSDN documentation. $CBS_UPPERCASE combo style is one example.

Related

GUICtrlCreate...

Example

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Example()

Func Example()
        GUICreate("My GUI style") ; will create a dialog box that when displayed is centered

        GUICtrlCreateLabel("my label which will split on several lines", 10, 20, 100, 100)
        GUICtrlSetStyle(-1, $SS_RIGHT)

        GUISetState(@SW_SHOW)

        ; Loop until the user exits.
        While 1
                Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE
                                ExitLoop

                EndSwitch
        WEnd
EndFunc   ;==>Example