)
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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Bring the nodes into the view without scrolling the diagram

Platform: WinForms |
Control: Diagram |
Published Date: February 23, 2018 |
Last Revised Date: May 31, 2019

In diagram control, we have a built-in support to bring the node into the view without scrolling the diagram. The following methods are used to bring the nodes into the view without scrolling the diagram.

BringToView:

The Syncfusion.Windows.Forms.Diagram.Controller’s “BringToView()” method is used to bring the given bounding rectangle area as viewable in the diagram. where, we need to pass the bounds area as a parameter.

[C#]

diagram1.Controller.BringToView(diagram1.View.SelectionList[0].BoundingRectangle);

 

[VB]

diagram1.Controller.BringToView(diagram1.View.SelectionList(0).BoundingRectangle)

 

BringToCenter:

The Syncfusion.Windows.Forms.Diagram.Controller’s “BringToCenter()” method is used to bring the given bounding rectangle area as center of the diagram’ view. Here, we need to send the needed bounds area as a parameter. Please refer to the below code example.

[C#]

diagram1.Controller.BringToCenter(diagram1.View.SelectionList[0].BoundingRectangle);

 

[VB]

diagram1.Controller.BringToCenter(diagram1.View.SelectionList(0).BoundingRectangle)

 

ScrollToNode:

Also we can bring the particular/selected node into the view without scrolling the diagram by using Syncfusion.Windows.Forms.Diagram.View’s “ScrollToNode()”  method. Please refer to the below code example. 

[C#]

diagram1.View.ScrollToNode (diagram1.View.SelectionList[0]);

 

[VB]

diagram1.View.ScrollToNode (diagram1.View.SelectionList(0))

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon