Thursday, March 4, 2010

Scrolling Webbrowser Control in C# and VB.net

I was searching long for to scroll webbrowser control to bottom or at specific point in Windows application. There where many solutions given but none was working. Specially if doctype is mentioned WebBrowserControl.Document.Body.ScrollTop = will not work. So I found a work around and it works 100%.

Solution:
WebBrowserControl.navigate("javascript:window.scroll(0,3050);");

You can change 3050 to the position you want. I used 3050 to scroll it to bottom.

Hope this help many people searching for solution.

Cheers

~ Upendra Kolte

www.ingenioustech.co.in