Skip to content

NodeColorPicker

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

nodecolorpicker

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);
Dim tb As New NodeTextBox()
tb.AttachTo(tree)
Dim nc As New NodeColorPicker()
nc.AttachTo(tree)

Dim node As 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);
Dim tb As New NodeTextBox()
tb.AttachTo(tree)
Dim nc As New NodeColorPicker()
nc.AttachTo(tree)

Dim node As New NodeWithGradient("Select a color")
' Default gradient.
node.Color = New ColorGradient(Color.Red, Color.Yellow, CInt(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);
Dim tb As New NodeTextBox()
tb.AttachTo(tree)
' NodeColorPicker is bound to the Color property.
Dim nc As New NodeColorPicker()
nc.AttachTo(tree)

' Add a node to select the solid color.
Dim node As New NodeWithColor("Select solid color")
node.Color = Color.Red
node.AttachTo(tree)

' Add a node to select the color gradient.
Dim node2 As New NodeWithGradient("Select color gradient")
node2.Color = New ColorGradient(Color.Red, Color.Yellow, CInt(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.