DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Posts
    134

    How do you make one line bold in a TreeView Class in WPF/C#?

    How do you make one line bold in a TreeView Class in WPF/C#?

    I mean, how do you make just one line in a Tree View bold at runtime?

  2. #2
    Join Date
    Sep 2007
    Posts
    86
    First you will need to find the node you want, then you can reference it. In this example I have a tree that looks like this:

    Code:
    Node0
         Node1
              Node4
              Node5
         Node2
              Node6
              Node7
         Node3
              Node8
              Node9
              Node10
    Here's the code to make Node8 bold:

    Code:
                TreeNode node = treeView1.Nodes[0].Nodes[2].Nodes[0];
                Font myFont = new Font("Verdana",12f, FontStyle.Bold);
                node.NodeFont = myFont;
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

Similar Threads

  1. Replies: 5
    Last Post: 10-17-2002, 01:58 PM
  2. Replies: 0
    Last Post: 01-16-2002, 10:46 AM
  3. Replies: 205
    Last Post: 09-26-2001, 01:37 PM
  4. Sample Sites.
    By Murray Foxcroft in forum Web
    Replies: 5
    Last Post: 11-02-2000, 02:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links