Flexible TreeView Flexible TreeView


Support & Community

NodeColorPicker node control

Previous Table of Contents Next

NodeColorPicker allows you to show the Office2007 style color or color gradient picker from a node with a very useful live preview feature.

Color picker node control



Select solid color

To select a solid color from the picker, add the NodeWithColor node instance to the treeview.  It has the Color property of the System.Drawing.Color type where the selected color will be stored.

Example:

NodeTextBox tb = new NodeTextBox();
tb.AttachTo(tree);
NodeColorPicker nc = new NodeColorPicker();
nc.AttachTo(tree);
 
NodeWithColor node = new NodeWithColor("Select color");
// default color.
node.Color = Color.Red;
node.AttachTo(tree);


Select color gradient

To select a color gradient from the picker, add the NodeWithGradient node instance to the treeview.  It has the Color property of the ARMSoft.FlexibleTreeView.Themes.ColorGradient type where the selected color gradient will be stored.

Example:

NodeTextBox tb = new NodeTextBox();
tb.AttachTo(tree);
NodeColorPicker nc = new NodeColorPicker();
nc.AttachTo(tree);
 
NodeWithGradient node = new NodeWithGradient("Select a color");
// default gradient.
node.Color = new ColorGradient(Color.Red, Color.Yellow, (int)eGradientAngle.LeftToRight);
node.AttachTo(tree);


Select solid color and color gradient using one node control

Flexible TreeView allows you to select both a solid color and a color gradient using one NodeColorPicker node control. To do that, add nodes of different types that contain either a solid color (NodeWithColor) or a color gradient (NodeWithGradient) Color property simultaneously.

Example:

NodeTextBox tb = new NodeTextBox();
tb.AttachTo(tree);
// NodeColorPicker is bound to the Color property.
NodeColorPicker nc = new NodeColorPicker();
nc.AttachTo(tree);
 
// add a node to select the solid color.
NodeWithColor node = new NodeWithColor("Select solid color");
node.Color = Color.Red;
node.AttachTo(tree);
 
// add a node to select the color gradient.
NodeWithGradient node2 = new NodeWithGradient("Select color gradient");
node2.Color = new ColorGradient(Color.Red, Color.Yellow, (int)eGradientAngle.LeftToRight);
node2.AttachTo(tree);

Additional API reference


Properties

  • PreviewSize – defines an area size that shows the selected color inside a node;
  • Editable – defines whether this node control allows you to change the color.

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.