MadaraUchiha Posted November 1, 2013 Share Posted November 1, 2013 Hello AutoIt-Community, I have a nasty Problem. First of let's show you some code, so you can better understand what I am talking about This is my GUI: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <GUIListView.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 225, 225, 747, 172) $ListView1 = GUICtrlCreateListView("Person|Number", 8, 8, 200, 165) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 90) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) $ListView1_0 = GUICtrlCreateListViewItem("Peter|5234", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("Bob|1234", $ListView1) $ListView1_2 = GUICtrlCreateListViewItem("Sally|5466", $ListView1) $ListView1_3 = GUICtrlCreateListViewItem("Julia|7543*", $ListView1) $ListView1_4 = GUICtrlCreateListViewItem("Marc|9999", $ListView1) $ListView1_5 = GUICtrlCreateListViewItem("Joe|4545", $ListView1) $ListView1_6 = GUICtrlCreateListViewItem("Nathan|4404", $ListView1) $Button1 = GUICtrlCreateButton("Get", 72, 192, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 for $index = 1 to _GUICtrlListView_GetItemCount($ListView1) $Name = _GUICtrlListView_GetItemText($ListView1, $index,1) If StringInStr($Name,'*') Then GUICtrlSetColor(_GUICtrlListView_GetItemText($ListView1,$name,1), 0xff0000) ; Red MsgBox(0,'found *',$Name) EndIf Next EndSwitch WEnd It contains a ListView with two Columns. The first column with names, the second with numbers. Now u can see that one of the subitems numbers has a * (Asteriks) at the End. (In this Case: Julia) I want every Row, where the SubItems text contains an Asteriks (*) to be marked red. (Mark the TextColor not the background!) I know I can mark Items read like this: GUICtrlSetColor($ListView1, 0xff0000) ; Red But for some reason the columns text won't get marked red? I mean I need to specifiy the index... I have a logic fail in my code somewhere, but I can't find it. Can u help me? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha,Just use GUICtrlSetColor on the relevant items: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <GUIListView.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 225, 225, 747, 172) $ListView1 = GUICtrlCreateListView("Person|Number", 8, 8, 200, 165) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 90) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) $ListView1_0 = GUICtrlCreateListViewItem("Peter|5234*", $ListView1) $ListView1_1 = GUICtrlCreateListViewItem("Bob|1234", $ListView1) $ListView1_2 = GUICtrlCreateListViewItem("Sally|5466", $ListView1) $ListView1_3 = GUICtrlCreateListViewItem("Julia|7543*", $ListView1) $ListView1_4 = GUICtrlCreateListViewItem("Marc|9999", $ListView1) $ListView1_5 = GUICtrlCreateListViewItem("Joe|4545", $ListView1) $ListView1_6 = GUICtrlCreateListViewItem("Nathan|4404", $ListView1) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 If StringInStr( _GUICtrlListView_GetItemText($ListView1, $i, 1), "*") Then GUICtrlSetColor($ListView1_0 + $i, 0xFF0000) EndIf Next ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $Button1 = GUICtrlCreateButton("Get", 72, 192, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 for $index = 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 ; ListView items start at index 0 <<<<<<<<<<<<<<<<<<<<<<<<< $Name = _GUICtrlListView_GetItemText($ListView1, $index,1) If StringInStr($Name,'*') Then GUICtrlSetColor(_GUICtrlListView_GetItemText($ListView1,$name,1), 0xff0000) ; Red MsgBox(0,'found *',$Name) EndIf Next EndSwitch WEndNote the change I made to the loop limits - try detecting the first * with the original limits and see what happens. M23 MadaraUchiha 1 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 (edited) Hey, awesome! Works! Thank you But I won't just copy/paste, so I like to ask some questions to understand better Can U explain this line: GUICtrlSetColor($ListView1_0 + $i, 0xFF0000) I don't understand why U specify the ListViewItem If its not sure which Item contains the * ? It would be cool if you can explain that, so I understand it properly Anyways, thanks for your help Because, what to do if the number of ListView Items is unknown? Edited November 1, 2013 by MadaraUchiha Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha, I won't just copy/paste, so I like to ask some questions to understand betterGood for you! why U specify the ListViewItem If its not sure which Item contains the * ?I have commented the code - does this explain better?; Loop through all items in the ListView - starting at 0 and going on until the total less one For $i = 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 ; Read the text of the subitem and see if it contains a * If StringInStr( _GUICtrlListView_GetItemText($ListView1, $i, 1), "*") Then ; If it does then we colour the item - but we only know the index of the item, not its ControlID ; So we add the index to the ControlID of the first item - which is item index 0 GUICtrlSetColor($ListView1_0 + $i, 0xFF0000) EndIf NextIf hope that also covers how you deal with a unknown number of ListViewitems - as long as you have the ControlID of the first you can easily get the others. To check your understanding, see if you can work out why this colours the correct items: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <GUIListView.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 225, 225, 747, 172) $ListView1 = GUICtrlCreateListView("Person|Number", 8, 8, 200, 165) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 90) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) $iStart_Items = GUICtrlCreateDummy() GUICtrlCreateListViewItem("Peter|5234*", $ListView1) GUICtrlCreateListViewItem("Bob|1234", $ListView1) GUICtrlCreateListViewItem("Sally|5466", $ListView1) GUICtrlCreateListViewItem("Julia|7543*", $ListView1) GUICtrlCreateListViewItem("Marc|9999", $ListView1) GUICtrlCreateListViewItem("Joe|4545", $ListView1) GUICtrlCreateListViewItem("Nathan|4404", $ListView1) For $i = 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 If StringInStr( _GUICtrlListView_GetItemText($ListView1, $i, 1), "*") Then GUICtrlSetColor($iStart_Items + $i + 1, 0xFF0000) EndIf Next $Button1 = GUICtrlCreateButton("Get", 72, 192, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 for $index = 1 to _GUICtrlListView_GetItemCount($ListView1) ; ListView items start at index 0 <<<<<<<<<<<<<<<<<<<<<<<<< $Name = _GUICtrlListView_GetItemText($ListView1, $index,1) If StringInStr($Name,'*') Then GUICtrlSetColor(_GUICtrlListView_GetItemText($ListView1,$name,1), 0xff0000) ; Red MsgBox(0,'found *',$Name) EndIf Next EndSwitch WEndPlease ask again if you are still having problems. M23M23 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 Hm, thanks for commenting. But in my case it won't mark it red. The number of listview items is unknown at beginning. So after all items are listed I got the index and the text of the *-Item. But it won't mark it... $iStart_Items = GUICtrlCreateDummy() For $i = 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 If StringInStr( _GUICtrlListView_GetItemText($ListView1, $i, 1), "*") Then GUICtrlSetColor($iStart_Items + $i + 1, 0xFF0000) EndIf Next for $index = 1 to _GUICtrlListView_GetItemCount($ListView) $Name = _GUICtrlListView_GetItemText($ListView1, $index,1) If StringInStr($Name,'*') Then GUICtrlSetColor(_GUICtrlListView_GetItemText($ListView1,$name,1), 0xff0000) ; Red MsgBox(0,'found *',$Name) EndIf Next ? I used your code... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha,Did you put the $iStart_Items = GUICtrlCreateDummy() line before the point where you started creating the ListView items? I suggest you post the whole script (I presume it is based on the one I helped you with yesterday) so that I can see what is happening. 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 (edited) No, I got the ID, I mean the Index of the Item to color. Now, lets say, our ListView is called $ListView1 and the Index number is saved in $Index. I only need to color the Items & SubItems Text in the ListView on Index $Index. But how? :s EDIT: My code, but not making the item red :c ; Mark Item Red For $Index= 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 If StringInStr( _GUICtrlListView_GetItemText($ListView1, $Index, 1), "*") Then MsgBox(0,'Index',$Index) MsgBox(0,'SubItem Text',_GUICtrlListView_GetItemText($ListView1, $Index,1)) GUICtrlSetColor(_GUICtrlListView_GetItemText($ListView1,$Index,1), 0xff0000) ; Red EndIf Next Edited November 1, 2013 by MadaraUchiha Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha,Where does this Index $Bot come from? And you should have realised by now that using the "Bot" word is like a red rag to a bull around here. But how?As I have already shown you in the scripts above - get a fixed ControlID (either the first listView item or a dummy created just beforehand) and add the index to it (+ 1 if you use the dummy). This works because AutoIt allocates ControlIDs in numerical order as follows:Control Index ControlID Dummy 10 (for this example only - it could be any number) ListViewItem_0 0 11 (Dummy + Index + 1 = 11) ListViewItem_1 1 12 (Dummy + Index + 1 = 12) ListViewItem_2 2 13 (Dummy + Index + 1 = 13) ListViewItem_3 3 14 (Dummy + Index + 1 = 14) ... ListViewItem_n n Dummy + Index + 1Does that help? 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 MadaraUchiha, Where does this Index $Bot come from? And you should have realised by now that using the "Bot" word is like a red rag to a bull around here. As I have already shown you in the scripts above - get a fixed ControlID (either the first listView item or a dummy created just beforehand) and add the index to it (+ 1 if you use the dummy). This works because AutoIt allocates ControlIDs in numerical order as follows: Control Index ControlID Dummy 10 (for this example only - it could be any number) ListViewItem_0 0 11 (Dummy + Index + 1 = 11) ListViewItem_1 1 12 (Dummy + Index + 1 = 12) ListViewItem_2 2 13 (Dummy + Index + 1 = 13) ListViewItem_3 3 14 (Dummy + Index + 1 = 14) ... ListViewItem_n n Dummy + Index + 1 Does that help? M23 Thanks so far, no I am not making a Bot, I got messed up with all my stuff, sorry. Ok, well: I know how to grab Index and SubItemtext, but I wonder why the Coloring routine won't work? In your example it did, but in my code: ; Mark Item Red For $Index= 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 If StringInStr( _GUICtrlListView_GetItemText($ListView1, $Index, 1), "*") Then MsgBox(0,'Index',$Index) MsgBox(0,'SubItem Text',_GUICtrlListView_GetItemText($ListView1, $Index,1)) GUICtrlSetColor(_GUICtrlListView_GetItemText($ListView1,$Index,1), 0xff0000) ; Red EndIf Next It won't? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha,Look at the ControlID parameter you are using in the GUICtrlSetColor call! You are using the subitem text while you actually need the ControlID - so it is hardly surprising that it does not work. I have tried explaining to the best of my ability how to get the ControlID of the ListView item from index of the item within the ListView - I cannot see how to make it any clearer. So I suggest you post the whole script and I will try and get it to work for you. Perhaps the penny will drop then. 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 Oh, I see, I am trying to set the SubItems Text as ID which obviously cannot work... I need to set the ID of the SubItem, right? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha, I need to set the ID of the SubItemExactly - and I explained how to get it from the item index in post #8. 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 I still can't get it? Can u tell me again how I get the Index of the SubItem with the * ? I tried $iStart_Items + $index + 1 but thats not working --> Nothing marked? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha,Post your code! 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 $iStart_Items = GUICtrlCreateDummy() For $i = 0 to _GUICtrlListView_GetItemCount($ListView1) - 1 If StringInStr( _GUICtrlListView_GetItemText($ListView1) $i, 1), "*") Then GUICtrlSetColor($iStart_Items + $i + 1, 0xFF0000) EndIf Next for $index = 1 to _GUICtrlListView_GetItemCount($ListView1) $Name = _GUICtrlListView_GetItemText($ListView1) $index,1) If StringInStr($Name,'*') Then MsgBox(0,'',$iStart_Items + $index + 1) GUICtrlSetColor($iStart_Items + $index + 1, 0xff0000) ; Red MsgBox(0,'found *',$Name) EndIf Next ... here u go Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha,So you expect me to write all the rest of the necessary code to get that to run? When it is probably something else in your script - like the way you fill the ListView - which is causing the problem in the first place? Be reasonable - post the whole script. 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 Thats not easy, because its a part of a big project... But basiclly, I download the Data for the ListView from my Server, and Split the Data by ||| check my old thread for this: '?do=embed' frameborder='0' data-embedContent>> Then the listview is filled and one of the numbers in the second column has a * at the end. Thats all. Now I like to mark this Persons ListView Entry Red. And thats what we are talking about here =) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha,I have explained several times how to get the ControlID of a ListView item from its index within the ListView so that you can use it in the GUICtrlSetColor function and have provided a couple of example scripts to show how it works. I can only assume that if you cannot get it to work then there must be something else in your script which is preventing it working - perhaps you do not create the items in immediate succession, or there is some other explanation which I cannot guess. After all my crystal ball is not infallible. So without sight of the rest of your script you cannot reasonably expect me to offer any more help - and I am certainly not going to give any. Good luck with your endeavours - I am out of here. 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...
MadaraUchiha Posted November 1, 2013 Author Share Posted November 1, 2013 Yes, I see how you get the Control ID of the ListView Item but I can't see how u get it of the specified SubItem? And also, isn't it possible iwhtout a Dummy? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2013 Moderators Share Posted November 1, 2013 MadaraUchiha, I see how you get the Control ID of the ListView Item but I can't see how u get it of the specified SubItem?You cannot - the whole item is a single control and so you can only colour the whole row. If you want individual subitems coloured then you are into owner-drawn ListViews - I think BugFix posted one a while back if you search. isn't it possible iwhtout a Dummy?You could create an array which stored the index and ControlID of each item as it was created and then use that to determine the relationship - but it seems a bit of an overkill. 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...
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