fenix114 Posted March 8, 2014 Share Posted March 8, 2014 HI I would like to create a list with a few name listed vertical probably with "GUICtrlCreateList" I would like the first name to be selected, when I start the form the "GUICtrlCreateInput" is selected and that was not my intention. Than I want the selected name to be read and put in a function ( I already got the function for that) after the function is done I want it to selected the name bellow, so it will finish the whole list of name's. can somebody please help me with this Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 (edited) fenix114,Welcome to the AutoIt forum. Please post the script you are using so we can offer sensible help - see here how to do it. M23Edit: And why do you share an IP and an email address with ArcLite86? Multiple accounts are not permitted here. Edited March 8, 2014 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GordonFreeman Posted March 8, 2014 Share Posted March 8, 2014 (edited) I think is better use a ComboBox, can be more hard for you get item clicked to exec the func on this type of control Edited March 8, 2014 by GordonFreeman Frabjous Installation Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 fenix114, Welcome to the AutoIt forum. Please post the script you are using so we can offer sensible help - see here how to do it. M23 thanks Melba23 Here i have the code and a screenshot I hope its all clear what I am trying to accomplish #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 487, 437, 368, 124) $List1 = GUICtrlCreateList("", 136, 24, 345, 396) $Button1 = GUICtrlCreateButton("start function", 8, 24, 113, 41) $addname = GUICtrlCreateInput("(add new name)", 16, 112, 113, 21) $Button2 = GUICtrlCreateButton("add new name", 16, 144, 113, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetData($list1, "example1|example2|example3|example4|example5|example6|example7|example8|example9|") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 ; a function.. EndSwitch WEnd Link to comment Share on other sites More sharing options...
GordonFreeman Posted March 8, 2014 Share Posted March 8, 2014 (edited) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 487, 437, 368, 124) $List1 = GUICtrlCreateList("", 136, 24, 345, 396) $Button1 = GUICtrlCreateButton("start function", 8, 24, 113, 41) $addname = GUICtrlCreateInput("(add new name)", 16, 112, 113, 21) $Button2 = GUICtrlCreateButton("add new name", 16, 144, 113, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetData($list1, "example1|example2|example3|example4|example5|example6|example7|example8|example9|") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 MsgBox(0,"", GUICtrlRead($List1));Get the text of select item in List and show in a MsgBox EndSwitch WEnd I still do not understand what you want (I'm bad with english). But maybe this can help Edited March 8, 2014 by GordonFreeman Frabjous Installation Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 fenix114,Before we go any further, please answer the question I posed above: why do you share an IP and an email address with ArcLite86?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 487, 437, 368, 124) $List1 = GUICtrlCreateList("", 136, 24, 345, 396) $Button1 = GUICtrlCreateButton("start function", 8, 24, 113, 41) $addname = GUICtrlCreateInput("(add new name)", 16, 112, 113, 21) $Button2 = GUICtrlCreateButton("add new name", 16, 144, 113, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetData($list1, "example1|example2|example3|example4|example5|example6|example7|example8|example9|") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 MsgBox(0,"", GUICtrlRead($List1));Get the text of select item in List and show in a MsgBox EndSwitch WEnd I still do not understand what you want (I'm bad with english). But maybe this can help That was not exactly wat I wanted first I want the "example1" to be selected than when I hit the "start function" button it starta a function and select's the name bellow in this case "example2" till the last name "example9" I also want to create a function with "add new name" button so when i type a name in the input a push the button a new name will appear on the list i have also looked the "ComboBox" but that was not really what I wanted Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 (edited) fenix114,Answer my question now! M23 Edited March 8, 2014 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 fenix114, Before we go any further, please answer the question I posed above: M23 we are not the same persons but we do share the same pc and I had a quick questions ( he recommended me to use this forum) I had some problems with login intro my email accounttahts why i used his and he didnt want me to use his account, I dont hope this is a problem Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 fenix114,That is fine - I just wanted to know. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 ok soon i will have acces to my email and be at my own pc Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 but could we please get back to my question: GordonFreeman, on 08 Mar 2014 - 8:01 PM, said: That was not exactly wat I wanted first I want the "example1" to be selected than when I hit the "start function" button it starta a function and select's the name bellow in this case "example2" till the last name "example9" I also want to create a function with "add new name" button so when i type a name in the input a push the button a new name will appear on the list i have also looked the "ComboBox" but that was not really what I wanted Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 fenix114,Is this close to what you want? #include <GUIConstantsEx.au3> #include <GUIListBox.au3> Global $iIndex = 0 $Form1 = GUICreate("Form1", 487, 437, 368, 124) $List1 = GUICtrlCreateList("", 136, 24, 345, 396) $Button1 = GUICtrlCreateButton("start function", 8, 24, 113, 41) $addname = GUICtrlCreateInput("(add new name)", 16, 112, 113, 21) $Button2 = GUICtrlCreateButton("add new name", 16, 144, 113, 25) GUISetState(@SW_SHOW) GUICtrlSetData($List1, "example1|example2|example3|example4|example5|example6|example7|example8|example9") _GUICtrlListBox_SetCurSel($List1, $iIndex) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 _GUICtrlListBox_AddString($List1, GUICtrlRead($addname)) Case $Button1 ; Function MsgBox($MB_SYSTEMMODAL, "Function", "Running on: " & GUICtrlRead($List1)) ; Move on $iIndex += 1 If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0 _GUICtrlListBox_SetCurSel($List1, $iIndex) EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 fenix114, Is this close to what you want? #include <GUIConstantsEx.au3> #include <GUIListBox.au3> Global $iIndex = 0 $Form1 = GUICreate("Form1", 487, 437, 368, 124) $List1 = GUICtrlCreateList("", 136, 24, 345, 396) $Button1 = GUICtrlCreateButton("start function", 8, 24, 113, 41) $addname = GUICtrlCreateInput("(add new name)", 16, 112, 113, 21) $Button2 = GUICtrlCreateButton("add new name", 16, 144, 113, 25) GUISetState(@SW_SHOW) GUICtrlSetData($List1, "example1|example2|example3|example4|example5|example6|example7|example8|example9") _GUICtrlListBox_SetCurSel($List1, $iIndex) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 _GUICtrlListBox_AddString($List1, GUICtrlRead($addname)) Case $Button1 ; Function MsgBox($MB_SYSTEMMODAL, "Function", "Running on: " & GUICtrlRead($List1)) ; Move on $iIndex += 1 If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0 _GUICtrlListBox_SetCurSel($List1, $iIndex) EndSwitch WEnd M23 thank you very much that was exaclty what in wanted Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 one last question, is it also possible to load a large list of name's from a excel (or a text ) fille, so i dont have to write all the name's over and over again Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 fenix114,Yes, look at FileReadToArray if you want to use a text file or the _Excel* functions if you want to use a spreadsheet. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
fenix114 Posted March 8, 2014 Author Share Posted March 8, 2014 ok thank you very much Melba23 Link to comment Share on other sites More sharing options...
fenix114 Posted March 12, 2014 Author Share Posted March 12, 2014 is it also possible to do this with 2 lists at the same time? so when start up the 2 first name''s of the 2 list are selected and when I press the "start funcion" button it will select the second name of the lists Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted March 12, 2014 Moderators Solution Share Posted March 12, 2014 fenix114,Easier to show than to explain: expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIListBox.au3> Global $iIndex = 0 $Form1 = GUICreate("Form1", 500, 500) $List1 = GUICtrlCreateList("", 140, 20, 170, 180) $List2 = GUICtrlCreateList("", 320, 20, 170, 180) $Button1 = GUICtrlCreateButton("start function", 10, 20, 120, 40) $addname1 = GUICtrlCreateInput("(add new name 1)", 15, 100, 110, 20) $addname2 = GUICtrlCreateInput("(add new name 2)", 15, 130, 110, 20) $Button2 = GUICtrlCreateButton("add new name", 15, 160, 110, 25) GUISetState(@SW_SHOW) GUICtrlSetData($List1, "example1|example2|example3|example4|example5|example6|example7|example8|example9") GUICtrlSetData($List2, "test1|test2|test3|test4|test5|test6|test7|test8|test9") _GUICtrlListBox_SetCurSel($List1, $iIndex) _GUICtrlListBox_SetCurSel($List2, $iIndex) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 _GUICtrlListBox_AddString($List1, GUICtrlRead($addname1)) _GUICtrlListBox_AddString($List2, GUICtrlRead($addname2)) Case $Button1 ; Function MsgBox($MB_SYSTEMMODAL, "Function", "Running on: " & GUICtrlRead($List1) & " - " & GUICtrlRead($List2)) ; Move on $iIndex += 1 If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0 _GUICtrlListBox_SetCurSel($List1, $iIndex) _GUICtrlListBox_SetCurSel($List2, $iIndex) EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
fenix114 Posted March 12, 2014 Author Share Posted March 12, 2014 thanks again melba 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