So I’ve created a new C# Windows Form, I’m using the Gecko Web Browser control and I want the browser to resize with the rest of my program (stretching or shrinking) as opposed to the “white space” of the program (the navigation bar, etc.) to resize. How might I cause the control to resize with the rest of the program?
Share
If you just want the control to grow proportionally to it’s original size (as opposed to
DockStyle.Fillwhich will take up the entire area), you can use theAnchorproperty. If you set the web browser control to be anchored Top, Left, Bottom and Right, then it will grow and shrink as the form is resized. It’s probably easiest to set it from the Visual Designer but if you want to do it via code you can use: