#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
$hGUI = GUICreate("GUI с элементом списка - List") ; Создаёт окно в центре экрана
$a1 = GUICtrlCreateButton(">>>>", 170, 30, 60, 25)
$a2 = GUICtrlCreateButton("<<<<", 170, 60, 60, 25)
$e1 = GUICtrlCreateButton("Добавить", 10, 285, 150, 25)
$e2 = GUICtrlCreateButton("Удалить", 10, 240, 150, 25)
$e3 = GUICtrlCreateInput("", 10, 315, 150, 20)
$mylist = GUICtrlCreateList("", 10, 10, 150, 190)
GUICtrlSetData(-1, 'Пункт 1|Пункт 2|Пункт 3', 'Пункт 2')
$mylist2 = GUICtrlCreateList("", 240, 10, 150, 190)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $a1
$tmp = GUICtrlRead($mylist)
If $tmp <> "" Then
GUICtrlSetData($mylist2, $tmp & "|")
$tmp1 = GUICtrlSendMsg($mylist, $LB_GETCURSEL, 0, 0)
GUICtrlSendMsg($mylist, $LB_DELETESTRING, $tmp1, $tmp1)
EndIf
Case $a2
$tmp = GUICtrlRead($mylist2)
If $tmp <> "" Then
GUICtrlSetData($mylist, $tmp & "|")
$tmp1 = GUICtrlSendMsg($mylist2, $LB_GETCURSEL, 0, 0)
GUICtrlSendMsg($mylist2, $LB_DELETESTRING, $tmp1, $tmp1)
EndIf
Case $e1
$tmp = GUICtrlRead($e3)
If $tmp <> "" Then
GUICtrlSetData($mylist, $tmp & "|")
GUICtrlSetData($e3, "")
EndIf
Case $e2
$tmp1 = GUICtrlSendMsg($mylist, $LB_GETCURSEL, 0, 0)
If $tmp1 >= 0 Then GUICtrlSendMsg($mylist, $LB_DELETESTRING, $tmp1, $tmp1)
EndSwitch
WEnd