Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to add ControlPoints in runtime with Bezier link style (Read 1547 times)
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
How to add ControlPoints in runtime with Bezier link style
Feb 12th, 2012 at 4:20pm
Print Post  
I want to create a link in problematically
here is my code
    Dim l As New DiagramLink(MainDiagram, MainDiagram.FindNode("path2"), MainDiagram.FindNode("path3"))
                l.Style = LinkStyle.Bezier
                l.SegmentCount = 1
                l.ControlPoints.Add(New PointF(303.9721, 318.855865))
                l.ControlPoints.Add(New PointF(390.0, 266))
                l.ControlPoints.Add(New PointF(481.342621, 313.7147))
                l.ControlPoints.Add(New PointF(570.0279, 311.1441))
                MainDiagram.Links.Add(l)


it is giving me exception "Parameter is not valid."
Why it is going wrong?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to add ControlPoints in runtime with Bezier link style
Reply #1 - Feb 13th, 2012 at 7:36am
Print Post  
Setting SegmentCount to 1 automatically adds four control points at default positions, I think you should overwrite them:

Code
Select All
l.ControlPoints(0) = New PointF(303.9721, 318.855865)
...
l.ControlPoints(3) = New PointF(570.0279, 311.1441)
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
Re: How to add ControlPoints in runtime with Bezier link style
Reply #2 - Feb 13th, 2012 at 8:23am
Print Post  
Thanks it it works now
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint