Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Create link at runtime (Read 2227 times)
suwit
Guest


Create link at runtime
Sep 28th, 2005 at 4:10pm
Print Post  

I need to create a link from node SRC to node DEST at runtime. but my code doesn't work. if anybody has successed on this please advise.

Thanks,

Suwit

My code
=================
Table tbl = m_gTable;
MindFusion.FlowChartX.Node src = (MindFusion.FlowChartX.Table)tbl;

Arrow link = new Arrow(this._flowChart);
                       

link.Visible = true;
link.ZIndex = 0;

tbl.Rows[m_gTableRowIndex].OutgoingArrows.Add(link);

dest.IncomingArrows.Add(link);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Create link at runtime
Reply #1 - Sep 28th, 2005 at 4:28pm
Print Post  
Either use the flowchart's CreateArrow method or use this Arrow constructor:

public Arrow(FlowChart parent, Node src, PointF dest)

to create the arrow and the add it to the flowchart with the Add method:

Arrow a = fc.CreateArrow(src, dst);

- or -

Arrow a = new Arrow(fc, src, dst);
fc.Add(a);

These methods add the new arrows to several collections - to fc.Objects, fc.Arrows, src.OutgoingArrows and dst.IncomingArrows.So use the methods instead of adding arrows manually to all the collections.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint