Creates a ComboBox control for the GUI.
GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )
Parameters
| text | The text which will appear in the combo control. |
| left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode. |
| top | The top of the control. If -1 is used then top will be computed according to GUICoordMode. |
| width | [optional] The width of the control (default is the previously used width). |
| height | [optional] The height of the control (default is the previously used height). |
| style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL forced style : $WS_TABSTOP |
| exStyle | [optional] Defines the extended style of the control. See Extended Style Table. |
Return Value
| Success: | Returns the identifier (controlID) of the new control. |
| Failure: | Returns 0. |
Remarks
To obtain the value of the control see GUICtrlRead.
Related
GUICoordMode (Option), GUICtrlSetData, GUICtrlUpdate..., GUIGetMsg
Example
#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $msg
GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered
GUICtrlCreateCombo("item1", 10, 10) ; create first item
GUICtrlSetData(-1, "item2|item3", "item3") ; add other item snd set a new default
GUISetState()
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example