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.

Expand and collapse controlnode

Thread ID:

Created:

Updated:

Platform:

Replies:

105819 Nov 20,2012 09:10 AM Nov 26,2012 05:57 AM Windows Forms 1
loading
Tags: Diagram
Allen Caughran
Asked On November 20, 2012 09:10 AM

I have a user control that is hosted in a ControlNode.  On the control I have a button that when clicked I change the size of the user control to either expand or shrink the control's size.  I would like to have the Control Node's size to change with the controls node.

Amsath Ali M [Syncfusion]
Replied On November 26, 2012 05:57 AM

Hi Allen,

 

Thanks for your interest in Syncfusion products.

 

We suggest you to use the ControlNode.HostingControl’s ‘SizeChanged’ event to update the controlNode’s size when the HostingControl’s size changed. Please refer the below code snippet to achieve your requirement.

 

Here is the code:

[C#]

cnode.HostingControl.SizeChanged += new EventHandler(HostingControl_SizeChanged);

 

void HostingControl_SizeChanged(object sender, EventArgs e)

        {

            diagram1.Model.BeginUpdate();

            cnode.Size = cnode.HostingControl.Size;

            cnode.HostingControl.Location = new Point((int)cnode.BoundingRectangle.X, (int)cnode.BoundingRectangle.Y);           

            diagram1.UpdateView(cnode);

            diagram1.Model.EndUpdate();

        }      

 

Here is the sample:

http://files2.syncfusion.com/dtSupport/DirectTrac/101068/F1058192110108194.zip

 

Please let us know if you have any queries.

 

Regards,

Amsath Ali. M


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.

;