Modifies the data for a control.
GUICtrlSetData ( controlID, data [, default] )
| controlID | The control identifier (controlID) as returned by a GUICtrlCreate... function. |
| data | Combo, List, ListView, ListViewItem: An Opt("GUIDataSeparatorChar",...) separated list of items. Progress: The percentage. Slider: The value. Group, Label, Button, Checkbox, Radio, Combo, List, Input, Edit, TabItem, TreeViewItem: Replaces the text. Date : The date or time depending the style of the control and the regional settings. Dummy: The value. |
| default | [optional] Combo, List: The default value. Edit, Input: If non-empty (""), the string is inserted at the current insertion point (caret). |
| Success: | Returns 1. |
| Failure: | Returns 0. |
| Returns -1 in case of invalid data |
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $msg
GUICreate("My GUI") ; will create a dialog box that when displayed is centered
GUICtrlCreateCombo("", 10, 10)
GUICtrlSetData(-1, "item1|item2|item3", "item3")
GUISetState() ; will display an empty dialog box with a combo control with focus on
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example