cntour Posted September 1, 2009 Share Posted September 1, 2009 $myList = GUICtrlCreateListView("Name|Description|Status|Startup Type|Log On As", 10, 15, 550, 300) $GUICtrlCreateListViewItem($ServiceName & "|" & $ServiceDes &"|"&$ServiceStatus&"|" &$ServiceStartType&"|"&$ServiceLogOnAs, $h_LV) While 1 $msg = GUIGetMsg() If $msg = 0 Then ContinueLoop If $msg = $GUI_EVENT_CLOSE Or $msg = $SL_Cancel Then GUIDelete($ServicesList) Return 0 EndIf if $msg = ???????? (How can I detect the item change here) then myFunc endif WEndthanks a lot. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 1, 2009 Moderators Share Posted September 1, 2009 cntour,Firstly, please do not take this personally, but....1. It is a lot easier to help if you post working code - having to add a working GUI, etc does not inspire people to help you...2. Please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here).OK, your problem... There are a bunch of functions to help you work with ListViews in the Help file - some of which I have used here:#include <GUIConstantsEx.au3> #Include <GuiListView.au3> $hGUI = GUICreate("Test", 500, 500) $myList = GUICtrlCreateListView("Name|Description|Status|Startup Type|Log On As", 10, 15, 550, 300) $LVItem1 = GUICtrlCreateListViewItem("Name1" & "|" & "Des1" & "|" & "Status1" & "|" & "StartType1" & "|" & "LogOnAs1", $myList) $LVItem2 = GUICtrlCreateListViewItem("Name2" & "|" & "Des2" & "|" & "Status2" & "|" & "StartType2" & "|" & "LogOnAs2", $myList) GUISetState() $sCurr_Selected = "" While 1 $msg = GUIGetMsg() If $msg = 0 Then ContinueLoop If $msg = $GUI_EVENT_CLOSE Then GUIDelete($hGUI) Exit EndIf $iIndex = _GUICtrlListView_GetNextItem($myList, -1, 0, 8) $sSelected = _GUICtrlListView_GetItemText($myList, $iIndex) If $sSelected <> $sCurr_Selected Then ConsoleWrite($sSelected & @CRLF) $sCurr_Selected = $sSelected EndIf WEndI hope this helps you do what you want. 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...
cntour Posted September 2, 2009 Author Share Posted September 2, 2009 M23, Thanks a lot. I didn't know I could include code in . Next time I will follow the rule. It works, I do appreciate your help. Cntour cntour, Firstly, please do not take this personally, but.... 1. It is a lot easier to help if you post working code - having to add a working GUI, etc does not inspire people to help you... 2. Please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). OK, your problem... There are a bunch of functions to help you work with ListViews in the Help file - some of which I have used here: #include <GUIConstantsEx.au3> #Include <GuiListView.au3> $hGUI = GUICreate("Test", 500, 500) $myList = GUICtrlCreateListView("Name|Description|Status|Startup Type|Log On As", 10, 15, 550, 300) $LVItem1 = GUICtrlCreateListViewItem("Name1" & "|" & "Des1" & "|" & "Status1" & "|" & "StartType1" & "|" & "LogOnAs1", $myList) $LVItem2 = GUICtrlCreateListViewItem("Name2" & "|" & "Des2" & "|" & "Status2" & "|" & "StartType2" & "|" & "LogOnAs2", $myList) GUISetState() $sCurr_Selected = "" While 1 $msg = GUIGetMsg() If $msg = 0 Then ContinueLoop If $msg = $GUI_EVENT_CLOSE Then GUIDelete($hGUI) Exit EndIf $iIndex = _GUICtrlListView_GetNextItem($myList, -1, 0, 8) $sSelected = _GUICtrlListView_GetItemText($myList, $iIndex) If $sSelected <> $sCurr_Selected Then ConsoleWrite($sSelected & @CRLF) $sCurr_Selected = $sSelected EndIf WEnd I hope this helps you do what you want. M23 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