本帖最后由 飘云 于 2010-10-13 22:41 编辑
包含#Include <GuiListBox.au3>后,用_GUICtrlListBox_InsertString($List2, GUICtrlRead($List1))来添加信息到$List2,用_GUICtrlListBox_DeleteString($List1,_GUICtrlListBox_GetCurSel($List1))来将$List1中的那个项目删除
代码大概就这样
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
$List1 = GUICtrlCreateList("", 72, 56, 105, 188)
GUICtrlSetData(-1,"test1")
GUICtrlSetData(-1,"test2")
GUICtrlSetData(-1,"test3")
GUICtrlSetData(-1,"test4")
GUICtrlSetData(-1,"test5")
GUICtrlSetData(-1,"test6")
GUICtrlSetData(-1,"test7")
GUICtrlSetData(-1,"test8")
$Button1 = GUICtrlCreateButton(">", 216, 64, 89, 33)
$Button2 = GUICtrlCreateButton("<", 216, 112, 89, 33)
$Button3 = GUICtrlCreateButton(">>", 216, 160, 89, 41)
$List2 = GUICtrlCreateList("", 344, 64, 113, 175)
$Button4 = GUICtrlCreateButton("<<", 216, 208, 89, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_GUICtrlListBox_InsertString($List2, GUICtrlRead($List1))
_GUICtrlListBox_DeleteString($List1,_GUICtrlListBox_GetCurSel($List1))
Case $Button2
_GUICtrlListBox_InsertString($List1, GUICtrlRead($List2))
_GUICtrlListBox_DeleteString($List2,_GUICtrlListBox_GetCurSel($List2))
EndSwitch
WEnd
|