Jump to content

Recommended Posts

Posted

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
Posted

Actually I am trying to set the color dynamically based on the Data which is getting uploaded as per Row wise.

Let me know if this is possible by any other means as well. Thank you...

Posted

Thank you very much Kylomas.

although i am not a advanced users like you all, this might help me. I am reading through the link and trying to incorporate it in my script.

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
×
×
  • Create New...