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.
Syncfusion Feedback

Scroll To End

Thread ID:

Created:

Updated:

Platform:

Replies:

44442 May 23,2006 09:07 PM UTC May 25,2006 07:25 AM UTC Windows Forms 1
loading
Tags: HTMLUIControl
Eric Robishaw
Asked On May 23, 2006 09:07 PM UTC

I''d like to scroll the HTML control to the end. I''ve looked at the example "HTMLUIScrolling", but it has a small problem: It scrolls the X (Horizontal scrollbar) as well as the vertical. I can''t figure out how to get the horizontal scroll bar to stay at the far left. Actually, I''m not sure I understand the ScrollToRectangle() method at all. The example has: Rectangle rect = new Rectangle(new Point(lastPoint.X, lastPoint.Y-10), new Size(0,10)); this.htmluiControl1.ScrollToRectangle(rect, this.htmluiControl1.Document); I thought changing the rect to: //Rectangle rect = new Rectangle(new Point(0, lastPoint.Y-10), new Size(10,10)); would work, but it cause no scrolling to occur at all. Any ideas?

Nandakumar R [Syncfusion]
Replied On May 25, 2006 07:25 AM UTC

Hi Eric, Thank you for pointing out the problem in the sample. This is corrected and will be available in the RTM version of Essential Studio 4.2. The HTMLUI control allows programmatic scrolling to a particular location or element with its extensive scroll properties support. One such method is the ScrollToRectangle method which adjusts the scrollbars to bring the specifed rectangle in to view. The suggestion you made failed because, the bounds in your suggestion are taken based on the bounds of the HTMLUI control. But the body tag element have some offset made internally for its display and the ScrollToRectangle requires a rectangle within the bounds of the document. So, we have to correct that offset inorder to get the coordinates for the rectangle to scroll. You can make the horizontal scrollbar at the far left with the help of the following code snippet. [C#] private void ScrollToEnd() { //Gets the body tag element IHTMLElement elem = this.htmluiControl1.Document.RenderRoot; Point lastPoint = new Point(0, (elem.Location.Y + elem.Size.Height)); //Rectangle adjusted to show the body element. Since it is necessary that the rectangle should be within the bounds of the document displayed in the htmlui control. Rectangle rect = new Rectangle(new Point(10, lastPoint.Y-10), new Size(10,10)); this.htmluiControl1.ScrollToRectangle(rect, this.htmluiControl1.Document); } Please refer the corrected sample, placed here as an attachment. Thank you for your interest in Syncfusion EssentialHTMLUI. Regards, Nanda HTMLUIScrolling.zip

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.

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

;