-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguiCtrlCreateList.au3
34 lines (28 loc) · 949 Bytes
/
guiCtrlCreateList.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <GUIConstantsEx.au3>
Opt('MustDeclareVars',1)
Example()
Func Example()
Local $MESSAGE = "The following buttons have been clicked"
Local $add, $clear, $mylist, $close, $msg
GUICreate("My GUI list") ; will create a dialog box that when displayed is created
$add = GUICtrlCreateButton("Add", 64, 32,75, 25)
$clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25)
$mylist = GUICtrlCreateList("Buttons that have been clicked", 176, 32, 121, 97)
GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
GUICtrlSetData(-1, $MESSAGE)
$close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25)
GUISetState()
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $add
GUICtrlSetData($mylist, "You clicked button NO1|")
Case $msg = $clear
GUICtrlSetData($mylist, "")
Case $msg = $close
MsgBox(0, "", "the closing button has been clicked", 2)
Exit
EndSelect
WEnd
EndFunc