Jump to content

How to do a Set different Text Back color on _GUICtrlListView_SetTextBkColor


SasiKumarN
 Share

Recommended Posts

Hi all,

Is there a way to set different back color on _GUICtrlListView_SetTextBkColor in a list view??

I am planning to change the color based on the Data in the List view.

Here for example if I need to mark Item 9 as RED and Item 6 as Green in Text back color, then please help me if possile.

Thanks,

Sasikumar Nithyanandam

#include 
#include 
#include 

$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
Local $hListView

GUICreate("ListView Set Text BkColor", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState()

; Set colors
_GUICtrlListView_SetBkColor($hListView, $CLR_MONEYGREEN)
_GUICtrlListView_SetTextColor($hListView, $CLR_BLACK)
_GUICtrlListView_SetTextBkColor($hListView, $CLR_MONEYGREEN)

; Add columns
_GUICtrlListView_AddColumn($hListView, "Items", 100)

; Add items
_GUICtrlListView_BeginUpdate($hListView)
For $iI = 1 To 10
_GUICtrlListView_AddItem($hListView, "Item " & $iI)
Next
_GUICtrlListView_EndUpdate($hListView)

; Show clors
MsgBox(4160, "Information", "Back Color ....: " & _GUICtrlListView_GetBkColor($hListView) & @CRLF & _
"Text Color ....: " & _GUICtrlListView_GetTextColor($hListView) & @CRLF & _
"Text Back Color: " & _GUICtrlListView_GetTextBkColor($hListView))

; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
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...