www.Chart4.NET | Samples

Control or container control associated with the hierarchy node.

Namespace:  UnifoChart.Hierarchy
Assembly:  UnifoChart.Hierarchy (in UnifoChart.Hierarchy.dll) Version: 2.6.0.0 (2.6)

Syntax

C#
public Control Control { get; set; }
Visual Basic (Declaration)
Public Property Control As Control
Visual Basic (Usage)
Dim instance As HierarchyNode
Dim value As Control

value = instance.Control

instance.Control = value
Visual C++
public:
property Control^ Control {
	Control^ get ();
	void set (Control^ value);
}
J#
/** @property */
public Control get_Control()
/** @property */
public  void set_Control(Control value)
JScript
public function get Control () : Control
public function set Control (value : Control)
JavaScript
function get_Control();
function set_Control(value);

Field Value

System.Windows.Forms.Control

Remarks

  • Nodes with controls is available only in HierarchyWin control (not in HierarchyWeb control) and only in non-3D chart.
  • If you set this property to display .NET controls and want to make the node background visible, then set a transparent background for the container control.
    Example:
    CopyC#
    Panel_1.BackColor = Color.FromArgb( 1, Color.Azure );
  • You can set an opaque backcolor or background image for the container control, in which case the node background will not be visible.
  • There is no need to set anchor or autosize property for the container control or for child controls. Controls will be resized according to node size.

Examples

CopyC#
private void Form1_Load( object sender, EventArgs e )
{
//Create a container control
Panel Panel1 = new Panel( );            
//If the node to be transparent, set the required alpha
Panel1.BackColor = Color.FromArgb( 1/*alpha*/, Color.Azure );

//Add a linklabel with its event handler
LinkLabel LinkLabel1 = new LinkLabel( );
LinkLabel1.Click += new EventHandler( LinkLabel1_Click );
LinkLabel1.Text = "Click";
Panel1.Controls.Add( LinkLabel1 );//add to container control

//Add a textbox
TextBox TextBox1 = new TextBox( );
TextBox1.Top = LinkLabel1.Height + 5/*gap*/;
Panel1.Controls.Add( TextBox1 );//add to container control

//Set the container control to the particular node
hierarchyWin1.hpcData.Nodes["Node3"].Control = Panel1;

//Refresh hierarchy chart display                        
hierarchyWin1.Refresh();
}
__________________________________________________
void LinkLabel1_Click( object sender, EventArgs e )
{
    MessageBox.Show("linked");
}

See Also