GoDiagram如何快速使用代码创建流程图节点和链接

作者:控件中国网   出处:控件中国网   2015-06-18 15:52:26   阅读:24

GoDiagram是一款用于绘制流程图、组织图、关系图、鱼骨图等的商业控件,是目前市场上功能最全面的一款流程图控件,丰富的API,内嵌多种图形和布局,扩展性和交互性强,并提供多种触发事件,使用起来方便简单,通过下面的事例,您可以看出仅用几句代码就可以绘制出一个简单的流程图了:

C#:

GoBasicNode node1 = new GoBasicNode();
node1.Location = new PointF(100, 100);
node1.Text = "first";
node1.Shape.BrushColor = Color.Blue;
goView1.Document.Add(node1);
GoBasicNode node2 = new GoBasicNode();
node2.Location = new PointF(200, 100);
node2.Text = "second";
node2.Shape.BrushColor = Color.Magenta;
goView1.Document.Add(node2);
GoLink link = new GoLink();
link.ToArrow = true;
link.PenColor = Color.Orange;
link.FromPort = node1.Port;
link.ToPort = node2.Port;
goView1.Document.Add(link);

VB.NET:

Dim node1 As GoBasicNode = New GoBasicNode()
node1.Location = New PointF(100, 100)
node1.Text = "first"
node1.Shape.BrushColor = Color.Blue
goView1.Document.Add(node1)
Dim node2 As GoBasicNode = New GoBasicNode()
node2.Location = New PointF(200, 100)
node2.Text = "second"
node2.Shape.BrushColor = Color.Magenta
goView1.Document.Add(node2)
Dim link As GoLink = New GoLink()
link.ToArrow = True
link.PenColor = Color.Orange
link.FromPort = node1.Port
link.ToPort = node2.Port
goView1.Document.Add(link)

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat