views:

418

answers:

2

I have a WebBrowser control on a form and have set the URL to a website. When I run the application the webpage is much larger than the size of the WebBrowser control and causes the WebBrowser to now contain a horizontal and vertical scrollbar.

I would like the webpage width inside the WebBrowser control to be resized to the WebBrowser's width so that I don't get the horizontal scrollbar, but have not seen a way to do this with coding. I have done some looking around and found one thing that might be worth trying. If I could download the page as an html file and then create a CSS stylesheet that has the page dimensions and then load that html file into the WebBrowser, that might be the way to go.

Can someone confirm if this would work or be the best way to do this? If someone can come up with a better solution, I'll take a look at that as well. Thanks.

A: 

Just create a CSS and use percentages for the heights and widths of your containers. If you need to learn about CSS a quick reference is W3School.

Bryan
+1  A: 

What you're looking for is called a fluid layout. Here's a tutorial on A List Apart which will help you build one of these.

Jason Berry
Here's the one I used. Derived in part from the article to which you've linked. http://matthewjamestaylor.com/blog/perfect-multi-column-liquid-layouts
Nosredna