|
-
Feb 25th, 2006, 09:02 PM
#1
Thread Starter
Lively Member
Changing The Color Of A List View
How do I change the color of the columns in a list view control (detail view).
Thanks
-
Feb 26th, 2006, 03:24 AM
#2
Re: Changing The Color Of A List View
You have two choices. The easy way is to set the UseItemStyleForSubItems property of each ListViewItem to False then set the BackColor of each ListViewSubItem in that column. The drawback is that if there is any space in the ListView the column will not be coloured. To do it properly you would have to draw the ListView yourself. There are ready-made controls or information on how to do it yourself at The Code Project or other places.
-
Feb 26th, 2006, 03:49 AM
#3
Thread Starter
Lively Member
Re: Changing The Color Of A List View
I can change each individual item that i add to the list but the main colum (the first one in the list at the very top) I cannot figure out how to change.
-
Feb 26th, 2006, 04:05 AM
#4
Re: Changing The Color Of A List View
Do you mean the first item in the list or the column header? If you mean the header then that would definitely require owner-drawing, perhaps even APIs to get to the underlying Win32 control. Have you read the stuff on The Code Project about owner-drawing ListViews?
-
Feb 26th, 2006, 04:13 AM
#5
Re: Changing The Color Of A List View
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Feb 26th, 2006, 04:23 AM
#6
Re: Changing The Color Of A List View
Good old Code Project. I wish I'd thought of that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|