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. Image for the cookie policy date

Automatic display of scrollbars

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?

Thanks,
John


1 Reply

AA Amsath Ali M Syncfusion Team 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:
[C#]
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;
}
else
{
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.

Regards,
Amsath Ali. M





Loader.
Live Chat Icon For mobile
Up arrow icon