Suresh Behera

The Microsoft .Net Junkies

News

Blogroll

Reading

Font with Bold and Italic

This make me so funny when I tried to make listview’s font to bold and italic. The various default properties of node does not allow to make changes because of get methods (No Set) .Here is way how i did it. 

TreeNode myNode;

Font myFont = new Font("Arial",8,FontStyle.Bold | FontStyle.Italic); // Passing two enum value

myNode.ForeColor = Color.Green; //Making Green

myNode.NodeFont = FontNode;//Assigning to TreeNode Font properties.

Suresh,[Microsoft MVP | MCAD.NET(CM) | MCSD.NET(EA)]

 

Comments

denis morozov said:

thanks!

I copletely forgot and was trying to OR it with II instead of I, thank you , I knew it was so simple

# July 17, 2007 2:42 PM

kri said:

To take common font for all nodes::

Font font = myNode.TeeeView.Font

# January 2, 2009 6:59 AM

Hema said:

Thanks the Above code has helped me a lot

Regards,

Hema

# June 19, 2009 6:50 AM

Anele Mbanga said:

Hi

I need something similar for vb6 treeview node, any ideas?

# April 28, 2010 4:15 AM

Milind said:

It works. Thanks!!

# October 22, 2010 1:34 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)