I have to give back color to tree view and list view.
Ex: For List View
In first line I want one color and for 2nd line I want another color.
Printable View
I have to give back color to tree view and list view.
Ex: For List View
In first line I want one color and for 2nd line I want another color.
it is not directly possible.
you would have to use some kind of overlay to do that.
Don't listen to Mike ... Can be done with the VB6 TreeView Control. Just requires subclassing.... Have done this myself and works fine. I can email you the project if you want it ...
The ListView just requires a bitmap. Set the Picture property with a bitmap with alternating colors.
Hope this helps!
For Trieview, you don't even need to subclass it. Below is the link on how to set the backcolor for the entire Trievew, and how to set the forecorlor for each item.
Changing Background Colours
For individual background color for nodes, here's the codeHope this will help youCode:With Me.TreeView1
.Nodes.Add(Text:="Node1").BackColor= RGB(255, 0, 0)
.Nodes.Add(Text:="Node2").BackColor = RGB(0, 255, 0)
End With
What u propose doesn't do the whole line - only the node text. To colour the whole treeview, it's a bit more complicated. Have a look at the attached image.
Yes... and what exactly do you think "can't be done directly and "some kind of overlay" means, eh?Quote:
Don't listen to Mike ... Can be done with the VB6 TreeView Control. Just requires subclassing....
You must have heard the word overlay before, as in a thing you lay over something else... as in subclassing, or multi windowing etc...
Lack of sleep ... but yer ... sorry mate.
I've the code to do it - just requires a little tweak to do what he wants ... not difficult.