Formatting Treeview control

J

Juan Romero

Hey guys,


I was wondering if anyone knows of a way to format the nodes in a treeview.
For instance, I would like to color or make bold the root Node.

Any ideas?

Thanks in advance!
 
A

Armin Zingler

Juan Romero said:
I was wondering if anyone knows of a way to format the nodes in a
treeview. For instance, I would like to color or make bold the root
Node.

Among others, a Treenode has the properties Nodefont, Backcolor, Forecolor.
 
H

Herfried K. Wagner [MVP]

* "Juan Romero said:
I was wondering if anyone knows of a way to format the nodes in a treeview.
For instance, I would like to color or make bold the root Node.

\\\
Dim t As TreeNode = ...
With t
.ForeColor = ...
.BackColor = ...
.NodeFont = New Font(...)
End With
///
 
J

Juan Romero

Thanks guys, you were right. However, when I change the font size, the
displaying rectangle does not resize, and half the text is not seen. How can
I handle this?

Thanks.

P.S.: Regarding the NodeFont property:

I wonder why Microsoft does such a thing.....
I mean they want to standarize everything for inheritance, yet they call the
property "NodeFont" instead of just "Font".... although come to think of it,
the node probably inherits the font property by default, maybe that is
why....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top