#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
Opt('MustDeclareVars', 1)
Global $hBtAdd, $hBtRead, $hBtDel, $hList, $iClicked
GUICreate('My GUI list')
$hBtAdd = GUICtrlCreateButton('Add', 10, 32, 75, 25)
$hBtRead = GUICtrlCreateButton('Read', 10, 32+32, 75, 25)
$hBtDel = GUICtrlCreateButton('Del', 10, 32+32+32, 75, 25)
$hList = GUICtrlCreateList('Buttons that have been clicked', 100, 32, 280, 100)
GUICtrlSetData(-1, 'The following buttons have been clicked')
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $hBtAdd
$iClicked += 1
_GUICtrlListBox_InsertString($hList, 'Clicked '& $iClicked &' button: Add', _GUICtrlListBox_GetListBoxInfo($hList))
Case $hBtRead
Local $sText='', $iStrings = _GUICtrlListBox_GetListBoxInfo($hList)
For $i = 0 To $iStrings - 1
$sText &= _GUICtrlListBox_GetText($hList, $i) & @CRLF
Next
MsgBox(64, 'Колличество строк: ' & $iStrings, $sText)
Case $hBtDel
_GUICtrlListBox_DeleteString($hList, _GUICtrlListBox_GetCurSel($hList))
EndSwitch
WEnd