请教怎么进行多项选取并添加至右边窗口
本帖最后由 273952582 于 2009-9-13 12:48 编辑#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 454, 192, 114)
$List1 = GUICtrlCreateList("", 64, 64, 177, 266)
$List2 = GUICtrlCreateList("", 328, 64, 185, 253)
$Button1 = GUICtrlCreateButton("添加>>", 256, 96, 65, 33, $WS_GROUP)
$Button2 = GUICtrlCreateButton("删除<<", 250, 211, 65, 33, $WS_GROUP)
GUICtrlSetData($List1,"1")
GUICtrlSetData($List1,"2")
GUICtrlSetData($List1,"3")
GUICtrlSetData($List1,"11")
GUICtrlSetData($List2,"12")
GUICtrlSetData($List2,"13")
GUICtrlSetData($List2,"14")
GUICtrlSetData($List2,"15")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd 添加 $LBS_EXTENDEDSEL 样式可多选~如:
$List1 = GUICtrlCreateList("", 64, 64, 177, 266, LBS_EXTENDEDSEL)
循环判断选中的索引,添加字符串到列表2后删除~
可以用到以下函数:
_GUICtrlListBox_GetCount($List1);获取项目总数
_GUICtrlListBox_GetSel($List1, $iIndex);获取项目的被选状态
_GUICtrlListBox_GetText($List1, $iIndex);获取索引的字符串
_GUICtrlListBox_DeleteString($List1, $iIndex);删除索引的字符串 又是你呀,大哥~~~谢谢啦~~~ 这个 _GUICtrlListView_CopyItems 的实例脚本很有趣!!!!!!!!!!!!!
页:
[1]