I have a Popupc WebBrowserinside (see code below). WebBrowser has one MaxWidth = "800". I want to automatically adjust the height of the web browser to its content height after loading the website, so it does not need a vertical ScrollBar.
I tried installing Height = "Auto"or MaxHeight = "5000", but I am not getting the correct result.
Can you help me how to do this? Thank you very much!
<Popup Name="popup1" VerticalOffset="3">
<Border BorderThickness="1">
<DockPanel>
<ScrollViewer MaxHeight="700" VerticalScrollBarVisibility="Auto">
<WebBrowser Name="wb1" MaxWidth="800"/>
</ScrollViewer>
</DockPanel>
</Border>
</Popup>
source
share