Janus Posted January 8, 2008 Share Posted January 8, 2008 (edited) Hi I need som help making a form with a list control. My problem is that the user select 3 point from the list and I have to find thoise points! Help my out Best Regard Janus S. Andrsen My code is like #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=c:\documents and settings\tester\desktop\epos hr $Form1_1 = GUICreate("Epos HR Downloader", 633, 454, 193, 115) GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1_1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1_1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1_1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1_1Restore") $List1 = GUICtrlCreateList("", 8, 32, 617, 253, BitOR($LBS_SORT, $LBS_MULTIPLESEL, $LBS_STANDARD, $WS_HSCROLL, $WS_VSCROLL, $WS_BORDER)) GUICtrlSetOnEvent(-1, "AList1Click") GUICtrlSetTip(-1, "Liste over de filer der kan downloades. Vælg de filer der skal hentes") $Label1 = GUICtrlCreateLabel("Navne på de filer som kan downloades", 8, 8, 188, 17) GUICtrlSetOnEvent(-1, "ALabel1Click") $Button1 = GUICtrlCreateButton("AButton1", 48, 304, 75, 25, 0) GUICtrlSetOnEvent(-1, "AButton1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetData($List1, $sArrayString) ;~ For $i = 1 To $rows Step 1 ;~ Send("{SPACE}{DOWN}") ;~ Next ;~ Run("notepad") ;~ Sleep(2000) ;~ Send($sArrayString) While 1 Sleep(100) WEnd Func AForm1_1Close() Exit EndFunc ;==>AForm1_1Close Edited January 8, 2008 by Janus Link to comment Share on other sites More sharing options...
smashly Posted January 8, 2008 Share Posted January 8, 2008 Hi, #include <GUIConstants.au3> #include <GUIListBox.au3> Opt("GUIOnEventMode", 1) $Form1_1 = GUICreate("Epos HR Downloader", 633, 454, 193, 115) GUISetOnEvent($GUI_EVENT_CLOSE, "Event") $List1 = GUICtrlCreateList("", 8, 32, 617, 253, BitOR($LBS_SORT, $LBS_MULTIPLESEL, $LBS_STANDARD, $WS_HSCROLL, $WS_VSCROLL, $WS_BORDER)) GUICtrlSetData(-1, "Item 1|Item 2|Item 3|Item 4|Item 5|Item 6") GUICtrlSetTip(-1, "Liste over de filer der kan downloades. Vælg de filer der skal hentes") $Label1 = GUICtrlCreateLabel("Navne på de filer som kan downloades", 8, 8, 188, 17) $Button1 = GUICtrlCreateButton("Get Selected", 48, 304, 90, 25) GUICtrlSetOnEvent(-1, "Event") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Event() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE Exit Case $Button1 Local $sList Dim $aList = _GUICtrlListBox_GetSelItems($List1) If $aList[0] <> "" Then For $i = 1 To $aList[0] $sList &= _GUICtrlListBox_GetText($List1, $aList[$i]) & @LF Next MsgBox(0,"Selected Items:", StringTrimRight($sList, 1)) Else MsgBox(0,"Nothing Selected.", "Nothing selected in list.") EndIf EndSwitch EndFunc Cheers Link to comment Share on other sites More sharing options...
rasim Posted January 8, 2008 Share Posted January 8, 2008 This? expandcollapse popup#include <GUIConstants.au3> #include <GuiListBox.au3> Dim $LBItemArray Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=c:\documents and settings\tester\desktop\epos hr $Form1_1 = GUICreate("Epos HR Downloader", 633, 454, 193, 115) GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1_1Close") ;GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1_1Minimize") ;GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1_1Maximize") ;GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1_1Restore") $List1 = GUICtrlCreateList("", 8, 32, 617, 253, BitOR($LBS_SORT, $LBS_MULTIPLESEL, $LBS_STANDARD, $WS_HSCROLL, $WS_VSCROLL, $WS_BORDER)) GUICtrlSetData(-1, "String_1") GUICtrlSetData(-1, "String_2") GUICtrlSetData(-1, "String_3") ;GUICtrlSetOnEvent(-1, "AList1Click") GUICtrlSetTip(-1, "Liste over de filer der kan downloades. V?lg de filer der skal hentes") $Label1 = GUICtrlCreateLabel("Navne pa de filer som kan downloades", 8, 8, 188, 17) ;GUICtrlSetOnEvent(-1, "ALabel1Click") $Button1 = GUICtrlCreateButton("AButton1", 48, 304, 75, 25, 0) ;GUICtrlSetOnEvent(-1, "AButton1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;GUICtrlSetData($List1, $sArrayString) ;~ For $i = 1 To $rows Step 1 ;~ Send("{SPACE}{DOWN}") ;~ Next ;~ Run("notepad") ;~ Sleep(2000) ;~ Send($sArrayString) While 1 $LBItemArray = _GUICtrlListBox_GetSelItems($List1) If $LBItemArray[0] = 3 Then MsgBox(0, "Yes", "3 items selected") Sleep(100) WEnd Func AForm1_1Close() Exit EndFunc ;==>AForm1_1Close Link to comment Share on other sites More sharing options...
Janus Posted January 8, 2008 Author Share Posted January 8, 2008 (edited) Thanks Janus S. Andersen Edited January 8, 2008 by Janus Link to comment Share on other sites More sharing options...
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