When I add a WebBrowser control on my TabPage, it doesn't have a border. I can't find a BorderStyle attribute. How do get the control to have a border? (3D, sunken, whatever)
Only by the scrollbar on the right you see there's actually a control there...
Gumpy comments, not accurate. Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of your toolbar onto your form.
using System;
using System.Windows.Forms;
class MyWebBrowser : WebBrowser {
protected override CreateParams CreateParams {
get {
var parms = base.CreateParams;
parms.Style |= 0x800000; // Turn on WS_BORDER
return parms;
}
}
}
The other border styles work too, check out WinUser.h in the SDK.
You can wrap the WebBrowser control in a Panel and set the Panel.BorderStyle property.
Panel panel1 = new Panel();
panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
panel1.Controls.Add(webbrowser1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With