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