RogerL Posted April 16, 2008 Share Posted April 16, 2008 (edited) If I use GUICtrlCreateListViewItem I believe I can change the text colour with GUICtrlSetColor. How do I change the text colour if I use _GUICtrlListView_AddItem as it returns the index instead of the controlId required by GUICtrlSetColor (and there isn't a _GUICtrlListView_SetItemTextColour function)? Sorry if this a novice question, I'm still trying to understand the difference between the standard GUIListView funcs and the UDF ones. Edited April 16, 2008 by RogerL Link to comment Share on other sites More sharing options...
BrettF Posted April 16, 2008 Share Posted April 16, 2008 Do you have anything to show for your attempts? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Zedna Posted April 16, 2008 Share Posted April 16, 2008 (edited) I have no idea but maybe some of AutoIt developers could tell us princip (which API is used) how it's done in GUICtrlSetColor() Edited April 16, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
rasim Posted April 17, 2008 Share Posted April 17, 2008 RogerLHelp rulez expandcollapse popup#include <GuiListView.au3> #include <GuiConstantsEx.au3> $Gui = GUICreate("Test", 320, 220) $hListView = _GUICtrlListView_Create($GUI, "Items|SubItems1|SubItems2", 10, 10, 300, 200, BitOR($LVS_EDITLABELS, $LVS_REPORT), $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_SUBITEMIMAGES, $LVS_EX_FULLROWSELECT)) _GUICtrlListView_SetColumnWidth($hListView, 0, 98) _GUICtrlListView_SetColumnWidth($hListView, 1, 98) _GUICtrlListView_SetColumnWidth($hListView, 2, 98) _GUICtrlListView_AddItem($hListView, "Item1") _GUICtrlListView_AddItem($hListView, "Item2") _GUICtrlListView_AddItem($hListView, "Item3") _GUICtrlListView_AddItem($hListView, "Item4") _GUICtrlListView_AddSubItem ($hListView, 0,'44', 1) _GUICtrlListView_AddSubItem ($hListView, 1,'22', 1) _GUICtrlListView_AddSubItem ($hListView, 2,'11', 1) _GUICtrlListView_AddSubItem ($hListView, 3,'33', 1) _GUICtrlListView_AddSubItem ($hListView, 0,'New', 2) _GUICtrlListView_AddSubItem ($hListView, 1,'Page', 2) _GUICtrlListView_AddSubItem ($hListView, 2,'Sys', 2) _GUICtrlListView_AddSubItem ($hListView, 3,'Device', 2) _GUICtrlListView_SetTextColor($hListView, $CLR_GREEN) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Link to comment Share on other sites More sharing options...
RogerL Posted April 17, 2008 Author Share Posted April 17, 2008 RogerLHelp rulez Thanks Rasim, looks nice, but not what I asked for.I want to know how to change the colour of the text of an individual item or sub-item, (created by the UDF functions), NOT every item and sub-item in the whole list view. Link to comment Share on other sites More sharing options...
Zedna Posted April 17, 2008 Share Posted April 17, 2008 Thanks Rasim, looks nice, but not what I asked for.I want to know how to change the colour of the text of an individual item or sub-item, (created by the UDF functions), NOT every item and sub-item in the whole list view.If you need each subitem in different color then it's possible only with ownerdraw. Seach for ownerdraw examples on the forum. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
RogerL Posted April 17, 2008 Author Share Posted April 17, 2008 If you need each subitem in different color then it's possible only with ownerdraw. Seach for ownerdraw examples on the forum.I'd settle for individual Items (i.e just column 1) if it was easier! Link to comment Share on other sites More sharing options...
Zedna Posted April 17, 2008 Share Posted April 17, 2008 (edited) Here is the link to ListBox ownerdraw example.EDIT: Also look here at some disccusion about that Edited April 17, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search 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