Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 20th, 2006, 12:49 AM
Authorized User
Join Date: Sep 2005
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Change treeview node font-style programmatically


I'm a newbie C# developer (2005) and I've created a database-driven treeview control. I have a method that's called once the main winform loads that pulls some basic information from the database to populate the treeview. The main three parent nodes are created with:

this.tvMain.Nodes.Add("Client Name");
My question is, how do I change the font style of this particular node to be bold?

Thanks in advance!


  #2 (permalink)  
Old May 23rd, 2006, 09:05 AM
Registered User
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Hello Panuvin!

Try to do this:

//Define a variable and stablish the created node with the variable
TreeNode node = tvMain.Nodes.Add("Client Name");

//Change the NodeFont property of the created node, as you need
node.NodeFont = new Font(tvMain.Nodes.Font, FontStyle.Bold);


José Antonio

  #3 (permalink)  
Old December 15th, 2007, 02:59 AM
Authorized User
Join Date: Dec 2007
Location: Bangalore, Karnataka, India.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pannasn

Hi Panuvin,

Can u please tell me how to combine fontstyles bold and italic i.e.,
(bold+italic). The text should be like this : Panuvin



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatically select a treeview node and expand simsen ASP.NET 2.0 Professional 0 June 23rd, 2008 01:57 AM
Different Font Style For Elements in Drop Down Box kunal_kishan HTML Code Clinic 1 July 11th, 2006 09:01 AM
ANYONE: Page Break in Excel / Font Style shagaset Classic ASP Basics 4 December 20th, 2004 01:09 PM
Page Breaks and Font Style in Excel shagaset Classic ASP Professional 2 December 14th, 2004 10:30 AM

All times are GMT -4. The time now is 12:51 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.