BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
this.htmluiControl1.KeyUp += HtmluiControl1_KeyUp;
private void HtmluiControl1_KeyUp(object sender, KeyEventArgs e)
{
if(e.KeyData == Keys.PageDown)
{
this.ScrollToEnd();
}
else if(e.KeyData == Keys.PageUp)
{
this.ScrollToTop();
}
}
private void ScrollToTop()
{
IHTMLElement elem = this.htmluiControl1.Document.RenderRoot;
this.htmluiControl1.ScrollToElement(this.htmluiControl1.Document.RenderRoot);
}
private void ScrollToEnd()
{
IHTMLElement elem = this.htmluiControl1.Document.RenderRoot;
Point lastPoint = new Point(0, (elem.Location.Y + elem.Size.Height));
Rectangle rect = new Rectangle(new Point(10, lastPoint.Y - 10), new Size(10, 10));
this.htmluiControl1.ScrollToRectangle(rect, this.htmluiControl1.Document);
} |