# 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.
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: | Returns 1.
Failure: | Returns 0.

Remarks

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

Related

GUICtrlCreate...

Example

#include <GUIConstants.au3>
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 ()
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend