We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Addint and removing ports on bounds change

Thread ID:





35931 Oct 14,2005 10:07 AM UTC Oct 26,2005 11:43 AM UTC WinForms 2
Tags: Diagram
Asked On October 14, 2005 10:07 AM UTC

Hi I have a long line symbol running across the doagram whose ports to be added acording to its width when resized. I am using the following code in bounds changed event.... protected override void OnBoundsChanged(BoundsEventArgs evtArgs) { for(int j = this.Ports.Count ; j>0; j--) { this.Ports.Remove(this.Ports[j-1]); } for(int i = 0;i

Meera Fathima [Syncfusion]
Replied On October 20, 2005 05:35 AM UTC

Hi Sachin, As per my update on the Direc Trac incident #21544, I will try to come up with a solution as soon as possible. And to draw the Start Cap/End Cap for a line, you can use the Line class FirstEndPointDecorator/LastEndPointDecorator properties. My apologies for the delay. Thanks for your support to Syncfusion. Regards, Meera.

Meera Fathima [Syncfusion]
Replied On October 26, 2005 11:43 AM UTC

Hi Sachin, I am sorry about this delay in getting back to you on this issue.The LineStyle class has only the EndCap property and StartCap property was leftout.A QA report regarding this issue has been logged, and we will fix the issue in a future release of the product. The incident id is #954. You can see the report details using our web based tracking system. The workaround for adding the StartCap would be to subclass the Line class, override the Line.Draw(...) method and add the start cap to the Pen after it gets created. Referring the Line.cs file will help you to work with this. As for adding the new ports, it is necessary to get hold of the symbol''s transformation matrix, and apply an inverse transform on the point to be used for the port.The following revised implementation of your OnBoundsChanged() method shows how to go about it, protected override void OnBoundsChanged(BoundsEventArgs evtArgs) { base.OnBoundsChanged (evtArgs); for(int j = this.Ports.Count ; j>0; j--) { this.Ports.Remove(this.Ports[j-1]); } float xoffset = this.X; while(xoffset < (this.X + this.Width)) { PointF ptworld = new PointF(xoffset, this.Location.Y + this.Height / 2); PointF[] pts = new PointF[] {ptworld}; Matrix worldxform = this.WorldTransform; worldxform.Invert(); worldxform.TransformPoints(pts); CirclePort cPort = new CirclePort(pts[0]); this.Ports.Add(cPort); xoffset += 10f; } } I hope the above information will help you. Please let me know if you need further assistance on this issue. Thanks for your patience and support. Regards, Meera.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon