hi,
ich hab ein problem das mich schon seid 2 tagen beschäftigt. ich hab 2 listboxen und möchte die ausgewählten items hin und her schieben
klingt erst mal leicht aber ich bekomm das einfach nicht hin :pinch: ich hab schon unzählige möglichkeiten probiert ...
vielleicht findet jemand von euch den fehler:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 440, 259, 192, 124)
$List1 = GUICtrlCreateList("", 8, 8, 161, 240,BitOR ($LBS_STANDARD, $LBS_EXTENDEDSEL))
GUICtrlSetData(-1, "test 1|test 2|test 3|test 4|test 5")
$List2 = GUICtrlCreateList("", 264, 8, 161, 240,BitOR ($LBS_STANDARD, $LBS_EXTENDEDSEL))
$Button1 = GUICtrlCreateButton("----->", 184, 8, 67, 33, $WS_GROUP)
$Button2 = GUICtrlCreateButton("<-----", 184, 56, 67, 33, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$x = _GUICtrlListBox_GetSelItems($List1)
$i = 0
If IsArray($x) Then
While $i < $x[0]
$x = _GUICtrlListBox_GetSelItems($List1)
$text = _GUICtrlListBox_GetText($List1,$x[1])
_GUICtrlListBox_AddString($List2,$text)
_GUICtrlListBox_DeleteString($List1,$x[1])
$i += 1
WEnd
EndIf
Case $Button2
$x = _GUICtrlListBox_GetSelItems($List2)
$i = 0
If IsArray($x) Then
While $i < $x[0]
$x = _GUICtrlListBox_GetSelItems($List2)
$text = _GUICtrlListBox_GetText($List2,$x[1])
_GUICtrlListBox_AddString($List1,$text)
_GUICtrlListBox_DeleteString($List2,$x[1])
$i += 1
WEnd
EndIf
EndSwitch
WEnd