Jump to content
Sign in to follow this  
jcma

Change color of each line for the control GUICtrlListView?

Recommended Posts

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

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...