Jump to content

Change color of each line for the control GUICtrlListView?


jcma
 Share

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
Link to comment
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,

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...