JJBean

  • Thread starter Thread starter Treeview
  • Start date Start date
T

Treeview

Hi All,

Can I set individual nodes to certain fonts/colors if I
like? and how do u do this?


Thanks,

JJBean
 
JJBean,

I assume you are speaking about the TreeView control in the
System.Windows.Forms namespace. Unless you custom paint the control, you
can not set the font and colors of the node individually.

Hope this helps.
 
Every node has a font property that you can set individualy.

myNode.NodeFont = new Font(tvBom.Font.FontFamily, tvBom.Font.Size,
FontStyle.Underline);

//you can set the color of the font by accessing the nodes forecolor

myNode.ForeColor = Color.Red;



hope this helps



MArco
 
Thats the last time I disagree with Nicholas...
Once set for the TreeView, all nodes keep the same font and color. The only
thing you can change is the fontStyle, like underline or bold.

Sorry about that.

Marco
 
ok How do I custom paint the control ?

Thanks for Responding !,

JJBean




-----Original Message-----
JJBean,

I assume you are speaking about the TreeView control in the
System.Windows.Forms namespace. Unless you custom paint the control, you
can not set the font and colors of the node individually.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi All,

Can I set individual nodes to certain fonts/colors if I
like? and how do u do this?


Thanks,

JJBean


.
 
Correction,

after playing a little, you CAN change the forecolor of a Node

node.ForeColor = Color.Red

works

Marco
 
Nicolas, Marco, what's the answer? how do you custom
paint the control, and more specifically can you custom
paint just certain nodes?

Thanks!

-----Original Message-----
ok How do I custom paint the control ?

Thanks for Responding !,

JJBean




-----Original Message-----
JJBean,

I assume you are speaking about the TreeView
control
in the
System.Windows.Forms namespace. Unless you custom
paint
the control, you
can not set the font and colors of the node individually.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi All,

Can I set individual nodes to certain fonts/colors if I
like? and how do u do this?


Thanks,

JJBean


.
.
 
Back
Top