日期:2014-05-18  浏览次数:21673 次

addflow的一些问题,高手请进
我最近在做一个关于流程的东西,用到了addflow,可是这玩意一时半会儿捉摸不透,也么有帮助文档,在网上找了一个小例子,可是运行之后发现一个问题,就是同鼠标在窗体内点击一下就有一个圆出来,不知道怎么回事,我估计是跟控件有关,因为我把代码全部注释之后还是可以,有谁可以说明一下呢?如果用过这个东西的,有教程的话,发给小弟一下,我也研究研究
这是代码:
C# code

 void sample()
        {
            //流程图样式
            addFlow1.Dock = DockStyle.Fill;
            addFlow1.AutoScroll = true;
            addFlow1.BackColor = SystemColors.Window;
            addFlow1.PageUnit = GraphicsUnit.Point;

            addFlow1.Grid.Draw = true;
            addFlow1.Grid.Snap = true;
            addFlow1.Grid.Style = GridStyle.Pixels;
            addFlow1.Grid.Color = Color.Silver;

            //节点阴影

            addFlow1.DefNodeProp.Shadow.Style = ShadowStyle.RightBottom;
            addFlow1.DefNodeProp.Shadow.Color = Color.Silver;
            addFlow1.DefNodeProp.Shadow.Size = new Size(4, 4);

            //线条样式

            addFlow1.DefLinkProp.Line.RoundedCorner = true;
            addFlow1.DefLinkProp.ArrowDst.Style = ArrowStyle.Arrow;
            addFlow1.DefLinkProp.ArrowDst.Angle = ArrowAngle.deg45;
            addFlow1.DefLinkProp.ArrowMid.Angle = ArrowAngle.deg45;
            addFlow1.DefLinkProp.BackMode = BackMode.Transparent;


            //addFlow1.DefLinkProp.Shadow.Style = ShadowStyle.RightBottom;
            //addFlow1.DefLinkProp.Shadow.Color = Color.Silver;
            //addFlow1.DefLinkProp.Shadow.Size = new Size(4, 4);

            addFlow1.BeginUpdate(); // 开始添加节点、线等控件

            Node node0 = addFlow1.Nodes.Add(60, 48, 112, 32);
            node0.Text = "开始";
            node0.Shape.Style = ShapeStyle.AlternateProcess;
            node0.FillColor = Color.LightYellow;
            Node node1 = addFlow1.Nodes.Add(76, 112, 80, 32);

            node1.Text = "自动判断?";

            node1.Shape.Style = ShapeStyle.Losange;
            Node node2 = addFlow1.Nodes.Add(60, 186, 112, 48);

            node2.Text = "跳过步骤?";
            node2.Shape.Style = ShapeStyle.Decision;
            Node node3 = addFlow1.Nodes.Add(60, 276, 112, 48);
            node3.Text = "再判断";
            node3.Shape.Style = ShapeStyle.Losange;

            Node node4 = addFlow1.Nodes.Add(60, 366, 112, 48);
            node4.Text = "处理步骤" + "\r\n" + "步骤1" + "\r\n" + "..." + "\r\n" + "步骤5";
            node4.Shape.Style = ShapeStyle.Rectangle;
            Node node5 = addFlow1.Nodes.Add(220, 112, 80, 32, "结束1");
            node5.Shape.Style = ShapeStyle.Termination;

            Node node6 = addFlow1.Nodes.Add(220, 286, 80, 32, "结束2");
            node6.Shape.Style = ShapeStyle.Termination;
            Node node7 = addFlow1.Nodes.Add(74, 460, 80, 32, "结束3");
            node7.Shape.Style = ShapeStyle.Termination;

            //线


            node0.OutLinks.Add(node1);
            node1.OutLinks.Add(node2, "no");
            node2.OutLinks.Add(node3, "no");
            node3.OutLinks.Add(node4, "yes");

            node1.OutLinks.Add(node5, "yes");

            node3.OutLinks.Add(node6, "no");

            Link link = node2.OutLinks.Add(node4, "yes");

            link.Line = new Line(LineStyle.HVH, false, true);
            link.Points[1] = new PointF(16, 210);

            link.Points[2] = new PointF(16, 390);
            node4.OutLinks.Add(node7, "end");
            addFlow1.EndUpdate();
        }




------解决方案--------------------
我在网上下载了一个AddFlow5,不过貌似是个很老的版本,因为只支持VB6,VC和Delphi。

它的帮助文档是这么说的
AddFlow is an ActiveX control that lets you quickly build flowchart-enabled applications.

而且它就是让人们可以在其上制作流程图的,因此我认为你说的那个点一下就出现一个圆,看起来像是生成了一个Node,这个应该是控件本身提供的一个功能。

至于具体的使用,LZ还是沉下心来看看帮助文档吧