pootie tang 0 Posted July 27, 2006 (edited) I have a listview (2 columns) which I want to from time to time change the text in 1 given item in column #2. For example, Column 1.................................................................Column2 My description...........................................................Initial Value (in black) after the change My description............................................................New Value (in red) All other data in the listview (include font color should remains as is). Any help would be appreicated. On a different note, I have asked the moderators to change my id (to remove confusion with others) ... have not heard back yet. Dave Edited July 27, 2006 by bigdaddy Share this post Link to post Share on other sites
big_daddy 20 Posted July 28, 2006 This should give you an idea. #include <GuiConstants.au3> #include <GuiListView.au3> $GUI = GUICreate("Test") $List = GUICtrlCreateListView("Column 1|Column 2", _ 10, 10, 380, 380, -1, $LVS_EX_FULLROWSELECT) _GUICtrlListViewSetColumnWidth($List, 0, 190) _GUICtrlListViewSetColumnWidth($List, 1, 190) GUISetState() For $i = 1 To 20 GUICtrlCreateListViewItem("My description " & $i & "|" & "Initial Value " & $i, $List) If $i = 5 Then GUICtrlSetColor(-1, 0x0000FF) ElseIf $i = 10 Then GUICtrlSetColor(-1, 0xFF0000) EndIf Next While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd p.s. The only mod around right now is jpm. Larry and JdeB are both on vacation. Share this post Link to post Share on other sites
SmOke_N 210 Posted July 28, 2006 Only Jon can change the name anyway... PM him. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
pootie tang 0 Posted July 28, 2006 This should give you an idea. #include <GuiConstants.au3> #include <GuiListView.au3> $GUI = GUICreate("Test") $List = GUICtrlCreateListView("Column 1|Column 2", _ 10, 10, 380, 380, -1, $LVS_EX_FULLROWSELECT) _GUICtrlListViewSetColumnWidth($List, 0, 190) _GUICtrlListViewSetColumnWidth($List, 1, 190) GUISetState() For $i = 1 To 20 GUICtrlCreateListViewItem("My description " & $i & "|" & "Initial Value " & $i, $List) If $i = 5 Then GUICtrlSetColor(-1, 0x0000FF) ElseIf $i = 10 Then GUICtrlSetColor(-1, 0xFF0000) EndIf Next While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd p.s. The only mod around right now is jpm. Larry and JdeB are both on vacation. Thanks ... I'll give it a shot ... I already PM'ed Jon ... haven't heard back yet Regards, Dave Share this post Link to post Share on other sites
pootie tang 0 Posted July 31, 2006 This should give you an idea. #include <GuiConstants.au3> #include <GuiListView.au3> $GUI = GUICreate("Test") $List = GUICtrlCreateListView("Column 1|Column 2", _ 10, 10, 380, 380, -1, $LVS_EX_FULLROWSELECT) _GUICtrlListViewSetColumnWidth($List, 0, 190) _GUICtrlListViewSetColumnWidth($List, 1, 190) GUISetState() For $i = 1 To 20 GUICtrlCreateListViewItem("My description " & $i & "|" & "Initial Value " & $i, $List) If $i = 5 Then GUICtrlSetColor(-1, 0x0000FF) ElseIf $i = 10 Then GUICtrlSetColor(-1, 0xFF0000) EndIf Next While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd p.s. The only mod around right now is jpm. Larry and JdeB are both on vacation. I gave it a shot ... worked perfectly. The only issue I ran into was if another window covered my window and then went away, the colors where lost. As long as another window didn't cover my window, it was ok. Any thoughts? Thanks. Dave p.s. id has been changed to pootie tang Share this post Link to post Share on other sites
livewire 2 Posted August 6, 2006 Is there any way to set color based on index (not ControlID)? Share this post Link to post Share on other sites