SLU5H Posted June 19, 2005 Posted June 19, 2005 Hi,... I need some help for ListBox. If I want to add items from list1 to list2, Its working pretty good! But, when I want remove one (choosen) item from list2, I can't realize it ... Also: #include <GUIConstants.au3> $list = ProcessList() $main3=GUICreate("Process-administrator",450,200) GUICtrlCreateLabel("Running Processes:", 10,5,100,20) $list1=GUICtrlCreateList ("procesy_1", 10,20,180,160) for $i = 1 to $list[0][0] GUICtrlSetData(-1,$list[$i][0]) next GUICtrlCreateLabel("Choosen Processes:", 250,5,100,20) $list2=GUICtrlCreateList ("procesy_2", 250,20,180,160) GUICtrlSetData(-1,"") $btn_add=GUICtrlCreateButton("add", 200,50,40,20) $btn_remove=GUICtrlCreateButton("remove", 200,90,40,20) GUISetState() While 1 $msg=Guigetmsg() select case $msg=$GUI_EVENT_CLOSE exit case $msg=$btn_add GuiCtrlSetData($list2, GuiCtrlRead($list1)) case $msg=$btn_remove ;?? EndSelect WEnd Thanks for any help/pointers! ........
HardCopy Posted June 20, 2005 Posted June 20, 2005 Requires Beta Version expandcollapse popup;;;beta v.3.1.1.48 #include <GUIConstants.au3> #Include <GuiList.au3> ;;added $list = ProcessList() $main3 = GUICreate("Process-administrator",450,200) GUICtrlCreateLabel("Running Processes:", 10,5,100,20) $list1=GUICtrlCreateList ("procesy_1", 10,20,180,160) for $i = 1 to $list[0][0] GUICtrlSetData(-1,$list[$i][0]) next GUICtrlCreateLabel("Choosen Processes:", 250,5,100,20) $list2=GUICtrlCreateList ("procesy_2", 250,20,180,160) GUICtrlSetData(-1,"") $btn_add=GUICtrlCreateButton("add", 200,50,40,20) $btn_remove=GUICtrlCreateButton("remove", 200,90,40,20) GUISetState() While 1 $msg=Guigetmsg() select case $msg=$GUI_EVENT_CLOSE exit case $msg=$btn_add GuiCtrlSetData($list2, GuiCtrlRead($list1)) case $msg=$btn_remove $i_index = _GUICtrlListGetCaretIndex($list2) ;;added _GUICtrlListDeleteItem($list2, $i_index) ;;added EndSelect WEnd Just 3 lines needed adding. HTH HardCopy Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now