jcma Posted December 25, 2007 Share Posted December 25, 2007 Hello, Is it possible to change color of each line for the control GUICtrlListView? Thanks, Link to comment Share on other sites More sharing options...
lotrfan01 Posted December 25, 2007 Share Posted December 25, 2007 Just use GUICtrlSetBkColor() Global $GUI = GUICreate("Multi-Colored Listview", 500, 500) Global $list_view = GUICtrlCreateListView("Item #|Color", 5, 5, 490, 490) Global $colors[5] = [0x00FF00, 0xFFFFFF, 0xFFFF00, 0xFF0000, 0x0000FF] For $x = 0 To 4 GUICtrlCreateListViewItem($x & "|" & Hex($colors[$x], 6), $list_view) GUICtrlSetBkColor(-1, $colors[$x]) ;replace $colors[$x] with the RGB color code you want to use Next GUISetState() While GUIGetMsg() <> -3 ;$GUI_EVENT_CLOSE WEnd Link to comment Share on other sites More sharing options...
jcma Posted December 26, 2007 Author Share Posted December 26, 2007 Just use GUICtrlSetBkColor() Global $GUI = GUICreate("Multi-Colored Listview", 500, 500) Global $list_view = GUICtrlCreateListView("Item #|Color", 5, 5, 490, 490) Global $colors[5] = [0x00FF00, 0xFFFFFF, 0xFFFF00, 0xFF0000, 0x0000FF] For $x = 0 To 4 GUICtrlCreateListViewItem($x & "|" & Hex($colors[$x], 6), $list_view) GUICtrlSetBkColor(-1, $colors[$x]) ;replace $colors[$x] with the RGB color code you want to use Next GUISetState() While GUIGetMsg() <> -3 ;$GUI_EVENT_CLOSE WEnd Thanks lotrfan01. This is what I needed!!! Thanks, 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