Flexible TreeView Flexible TreeView


Support & Community

Customize appearance for every node

Previous Table of Contents Next

Generally, Flexible TreeView allows you to define the node control appearance for all nodes at one time. To be able to define different node control`s appearance for every node you need to override these node control methods:

  • GetFont – to change the node control font for every node;
  • GetTextColor - to change the node control`s text color for every node;
  • GetTitleFont – to change the expandable node control`s title font;
  • GetTitleColor – to change the expandable node control`s title color;
  • GetDescriptionFont – to change the NodeExpandableTextBox`s description font;
  • GetDescriptionColor – to change the NodeExpandableTextBox`s description color.

To do that, you need to inherit your new node control class from the built-in one, override one of these methods and install this node control into a treeview as shown below:

// The node control which displays a bold text when node is selected or focused.
class MyNodeTextBox : NodeTextBox
{
  public override Font GetFont(Node pNode, DrawContext pContext)
  {
    Font font = base.GetFont(pNode, pContext);
    if (pNode.IsSelected)
    {
      font = new Font(font, FontStyle.Bold);
    }
    return font;
  }
}
 
// use our new node control.
MyNodeTextBox tb = new MyNodeTextBox();
tb.AttachTo(tree);

Previous Top Next


Last news
Bookmark and Share
Use Flexible TreeView in WPF project
Sunday, 18 December 2011

Do you have a WPF project and want to use Flexible TreeView there? No problem!

Flexible TreeView v3.4
Friday, 16 December 2011

Flexible TreeView v3.4 maintenance release has been released.

Flexible TreeView v3.3
Friday, 23 September 2011

Flexible TreeView v3.3 maintenance release has been released. Separate assemblies for .NET 2.0, 4.0 and 4.0 Client Profile, HTML markup extension, etc.

Latest release

Version:
Release date:
3.4
Dec 16, 2011


Copyright © 2006-2012 ARMSoft. All rights reserved.