I have a simple wpf window in which there is a Scrollviewer and inside it there is a web browser.
<Window x:Class="WpfApplication9.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" Background="Gainsboro"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"/> <ColumnDefinition Width="300"/> </Grid.ColumnDefinitions> <ScrollViewer Width="300" Grid.Column="1" Height="200" HorizontalScrollBarVisibility="Auto"> <WebBrowser Width="400" Margin="2" Source="C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg" /> </ScrollViewer> </Grid>
As I pointed out the width in the browser that is larger than the width of the Scroll Viewer, I expect the scroll viewer to show a horizontal scroll bar and show the web browser in the scroll viewer.
But when I horizontally scroll to the right, the web browser moves from the scroll widget.
Am I doing something wrong? Or is there a workaround for this?
Any help is greatly appreciated. Thanks.
browser wpf scrollviewer
user501579
source share