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

Automatic display of scrollbars

Thread ID:





101429 Oct 25,2011 07:08 AM UTC Oct 31,2011 05:58 AM UTC WinForms 1
Tags: Diagram
Johnathan Tunnicliffe
Asked On October 25, 2011 07:08 AM UTC

Is it possible to have the scrollbars only show when necessary? i.e. if there's nothing to see horizontally then don't show scrollbars but if there is something out of view then show scrollbars?


Amsath Ali M [Syncfusion]
Replied On October 31, 2011 05:58 AM UTC

Hi Johnathan,

Thanks for your interest in Syncfusion products.

We suggest you to use the Diagram.View’s ‘ClientRectangle’ property to achieve your requirement.

Here is the code:
diagram1.Model.EventSink.PinPointChanged += new PinPointChangedEventHandler(EventSink_PinPointChanged);
Node node = evtArgs.NodeAffected as Node;
System.Drawing.Rectangle rg = diagram1.View.ClientRectangle;
if (rg.Height < (node.BoundingRectangle.Y + node.BoundingRectangle.Height) || rg.Width < (node.BoundingRectangle.X + node.BoundingRectangle.Width))
diagram1.HScroll = true;
diagram1.VScroll = true;
diagram1.HScroll = false;
diagram1.VScroll = false;

Here is the sample:
Forum AutoScroll-1907514570.zip

Please try the above sample and let us know if you have any queries.

Amsath Ali. M


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