jonny1234 Posted December 3, 2006 Posted December 3, 2006 Hi, I'm creating ListView items using MyGUICtrlCreateListViewItem from example 2 of GUICtrlRegisterListViewSort in the AutoIt help file. Unlike GUICtrlCreateListViewItem, MyGUICtrlCreateListViewItem returns the index of the newly-created item and not its control ID. But I need the item's control ID to pass to GUICtrlSetBkColor in order to set the background colour of the item. Please can you help. Regards, Jonny
GaryFrost Posted December 3, 2006 Posted December 3, 2006 (edited) Hi,I'm creating ListView items using MyGUICtrlCreateListViewItem from example 2 of GUICtrlRegisterListViewSort in the AutoIt help file.Unlike GUICtrlCreateListViewItem, MyGUICtrlCreateListViewItem returns the index of the newly-created item and not its control ID. But I need the item's control ID to pass to GUICtrlSetBkColor in order to set the background colour of the item.Please can you help.Regards,JonnyYou can select the item then use GuiCtrlRead of the listview to get the id of the selected item.Sorry don't think that will work unless you use GuiCtrlCreateListViewItem Edited December 3, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
jonny1234 Posted December 3, 2006 Author Posted December 3, 2006 You can select the item then use GuiCtrlRead of the listview to get the id of the selected item.Sorry don't think that will work unless you use GuiCtrlCreateListViewItemYou're right, it doesn't. It always returns 0.But if I use GuiCtrlCreateListViewItem, then the sorting won't work.Perhaps I'll have to find a way to set the item background colour, other than by using GUICtrlSetBkColor.Regards,Jonny
GaryFrost Posted December 3, 2006 Posted December 3, 2006 You're right, it doesn't. It always returns 0.But if I use GuiCtrlCreateListViewItem, then the sorting won't work.Perhaps I'll have to find a way to set the item background colour, other than by using GUICtrlSetBkColor.Regards,JonnyUse the methods from the first example not the second one and it should work. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
jonny1234 Posted December 3, 2006 Author Posted December 3, 2006 Use the methods from the first example not the second one and it should work.You're right, it does. Thanks.Regards,Jonny
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