I want to scroll down or up in the webbrowser control on the windows phone 7 using code behind (no javascript). i mean like using some button to scroll down for example. is that possible?
EDIT:
I tried to call a javascript function using InvokeScript, but it keeps giving me an unknown error 80020006. i tried to do this:
public MainPage()
{
InitializeComponent();
webBrowser1.Navigate(new Uri("http://www.msn.com"));
}
private void button1_Click(object sender, RoutedEventArgs e)
{
webBrowser1.InvokeScript("window.scrollBy(100,100);");
}
something wrong in my code?
There is no way to interact with the scrolling of the page inside a WebBrowser control from outside of it.
In terms of doing it with JavaScript look at
windows.scrollBy()update
Try
webBrowser1.InvokeScript("eval", "window.scrollBy(100,100);");But be aware that the page you’re viewing may have overridden
evalwhich coudl prevent this from running.Note that the WebBrowser control was not intended to be used to view websites directly.
Also, have you tried calling
scrollBydirectly from within your own page?