tags:

views:

2845

answers:

2

In C# 2.0 does anyone know how to display the count of children nodes like Outlook does with unread emails. Also, if the count displayed can be in a different color to the node text.

Has anyone achieved this with "Safe" code?

+3  A: 

In order to display a string with more than one color you'd have to do custom GDI drawing in the treeview. Here's a chapter on how to do OwnerDrawn controls:

http://books.google.com/books?id=zDi4LIDvd4wC&pg=PA396&lpg=PA396&dq=treeview+ownerdrawn&source=web&ots=hJIvexSusO&sig=XR8-ktfgllcjFmGs0FSfP0HYqIc&hl=en&sa=X&oi=book_result&resnum=5&ct=result#PPA398,M1

Steven Behnke
That is a great book. I was always using it when I used to be in WinForms land. The chapter on printing really saved me on a project.
Jason Jackson
A: 

inherit from the treeview control then change it to suit your needs

Russ Bradberry