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.

Automatic display of scrollbars

Thread ID:

Created:

Updated:

Platform:

Replies:

101429 Oct 25,2011 03:08 AM Oct 31,2011 01:58 AM Windows Forms 1
loading
Tags: Diagram
Johnathan Tunnicliffe
Asked On October 25, 2011 03:08 AM

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


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

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





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.

;