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.
Unfortunately, activation email could not send to your email. Please try again.

Custom ConnectionPoint

Thread ID:

Created:

Updated:

Platform:

Replies:

93667 Mar 27,2010 03:07 AM Apr 6,2010 04:48 AM Windows Forms 3
loading
Tags: Diagram
Domenico Mozzone
Asked On March 27, 2010 03:07 AM

Dear Support,
I'm trying to draw a custom ConnectionPoint. I mean a ConnectionPoint with a my own shape.
I tried to set the property ConnectionPoint.VisualType = PortVisualType.Custom and then to assign the ConnectionPoint.GraphicsPath to have my conncetion point shape, but I miss something as the custom connectionpoint is not visible on the node.
To set the Custom Cconnectionpoint color I used the FillStyle property.

Thank you
Best Regards
Domenico

Domenico Mozzone
Replied On March 27, 2010 03:21 AM

A clarification
setting Connectionpoint properties as explained in my post the result is a Connectionpoint with X symbol.
Best Regard
Domenico Mozzone

Melba Winshia [Syncfusion]
Replied On March 29, 2010 09:23 AM

Hi Domenico,

Thank you for your interest in Syncfusion Products.

Please use below code to draw a custom ConnectionPoint:

[C#]

private void Form1_Load(object sender, EventArgs e)
{
Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 100, 100, 100);
rect.EnableCentralPort = false;
ConnectionPoint cp = new ConnectionPoint();
cp.Position = Position.MiddleRight;
cp.VisualType = PortVisualType.Custom;
cp.GraphicsPath = CustomShape();
rect.Ports.Add(cp);
this.diagram1.Model.AppendChild(rect);
this.diagram1.Controller.ActivateTool("LineLinkTool");
}

private GraphicsPath CustomShape()
{
GraphicsPath gp = new GraphicsPath();
Size szText = TextRenderer.MeasureText("$", new Font(FontFamily.GenericSansSerif, 12));
gp.AddString("$", FontFamily.GenericSansSerif, 1, 12, new Point(-szText.Width / 2, -szText.Height / 2), new StringFormat(StringFormatFlags.NoWrap));
return gp;
}

Please let me know if this helps.

Thanks,
Melba


Domenico Mozzone
Replied On April 6, 2010 04:48 AM

Thank you Melba,
your example helped me in finding that the problem was related to my graphicpath.
Have a nice day
Best Regards
Domenico Mozzone

CONFIRMATION

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.

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.

;