private void Add(int count)
{
GuYuGplot.Gplot gplot = new GuYuGplot.Gplot();
gplot.Width = this.Height;
gplot.Dock = DockStyle.Left;
this.Controls.Add(gplot);
Node rootNode = new Node();
rootNode.Text = "Root";
rootNode.Width = 50;
rootNode.Height = 50;
rootNode.NodeType = Enums.NodeType.Circle;
for (int i = 0; i < count; i++)
{
Node cNode = new Node();
cNode.Text = "C" + i.ToString();
cNode.Color = Color.Red;
cNode.Width = 40;
cNode.Height = 40;
cNode.NodeType = Enums.NodeType.Rect;
Line line = new Line();
line.Color = Color.RoyalBlue;
line.Length = 80;
cNode.Line = line;
rootNode.ChildNodes.Add(cNode);
}
gplot.NodesTree.RootNode = rootNode;
}
{
GuYuGplot.Gplot gplot = new GuYuGplot.Gplot();
gplot.Width = this.Height;
gplot.Dock = DockStyle.Left;
this.Controls.Add(gplot);
Node rootNode = new Node();
rootNode.Text = "Root";
rootNode.Width = 50;
rootNode.Height = 50;
rootNode.NodeType = Enums.NodeType.Circle;
for (int i = 0; i < count; i++)
{
Node cNode = new Node();
cNode.Text = "C" + i.ToString();
cNode.Color = Color.Red;
cNode.Width = 40;
cNode.Height = 40;
cNode.NodeType = Enums.NodeType.Rect;
Line line = new Line();
line.Color = Color.RoyalBlue;
line.Length = 80;
cNode.Line = line;
rootNode.ChildNodes.Add(cNode);
}
gplot.NodesTree.RootNode = rootNode;
}
}
this.Add(3);
项目实例保存至我的资源