WeMartiansAreFriendly Posted November 11, 2008 Share Posted November 11, 2008 (edited) Is it possible to set the background color of an individual Listview item created by the _GUICtrlListView functions? Where's _GUICtrlListView_SetItemBkColor and _GUICtrlListView_SetItemTextColor ? expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <Constants.au3> GUICreate("ListView Set 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 $iItem = _GUICtrlListView_AddItem($hListView, "Item " & $iI) If Mod($iI, 2) Then ;_GUICtrlListView_SetItemBkColor($hListView, $iItem, 0xc0c0c0); Could such a function exist? Else ;_GUICtrlListView_SetItemBkColor($hListView, $iItem, 0xffffff) EndIf 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() Edited November 20, 2008 by Kastout Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
rover Posted November 12, 2008 Share Posted November 12, 2008 http://www.autoitscript.com/forum/index.ph..._NOTIFYITEMDRAWGUiCtrlListView and the $GUI_BKCOLOR_LV_ALTERNATEAlternating row background color?, _GUICtrlListView_Createhttp://www.autoitscript.com/forum/index.ph...mp;#entry470173 I see fascists... Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted November 13, 2008 Author Share Posted November 13, 2008 http://www.autoitscript.com/forum/index.ph..._NOTIFYITEMDRAWGUiCtrlListView and the $GUI_BKCOLOR_LV_ALTERNATEAlternating row background color?, _GUICtrlListView_Createhttp://www.autoitscript.com/forum/index.ph...mp;#entry470173I guess I was being optimistic in thinking this was a simple matter of single function call. Regardless, thanks for the info. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted November 20, 2008 Author Share Posted November 20, 2008 (edited) I suppose this method draws the background color/text color as it is created or "drawn" thus it can't be changed later on? I need to change the background after an item has been created, or on the fly if you will, I wish I understood how this worked, but I don't. Something like _GUICtrlListView_SetItemBkColor() would be nice. Too sum up I need the same functionality of GUICtrlCreateListViewItem() and GUICtrlSetBKColor() with the _GUICtrlListView_ functions Edited November 20, 2008 by Kastout Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
aNewLyfe Posted November 21, 2008 Share Posted November 21, 2008 try: $lwitem = guictrlcreatelistviewitem.... guictrlsetbkcolor(-1,....) not stable but its working while creation. ~ Every Living Thing is a Code Snippet of World Application ~ 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