Val
Val

Reputation: 639

Programmatic WebBrowser scrolling

Is it possible to somehow programmatically scroll WebBrowser Silverlight control?

        <WebBrowser
        x:Name="BrowserControll"
        HorizontalAlignment="Stretch"
        VerticalAlignment="Stretch"
        Margin="10,10,10,0"
        Source="http://www.google.com" />

Upvotes: 0

Views: 280

Answers (1)

Matt Bridges
Matt Bridges

Reputation: 49385

You can use WebBrowser.InvokeScript(), and pass in some javascript that will scroll the browser to the desired location. See the window.scrollTo() javascript method.

For example:

BrowserControl.InvokeScript("window.scrollTo(0,100)");

Would scroll the browser 100 pixels down.

Upvotes: 1

Related Questions