从WebBrowser控件中删除边框边框、控件、WebBrowser

2023-09-03 05:03:03 作者:灰太狼

我有一个WebBrowser控件坐在里面有刺激性2px的插图看的边境周围窗体上。它使我的内容由4 PX在右侧和底部被剪切,我不能找出如何摆脱它。该控件本身没有任何边框样式属性 - ?一个人如何删除边框

I've got a WebBrowser control sitting on a Form which has an irritating 2px inset-looking border around it. It's causing my content to be clipped by 4 px on the right and bottom, and I can't figure out how to get rid of it. The control itself doesn't have any BorderStyle properties -- how does one remove the border?

请参阅红色区域中的截屏:

See the red area in the screen shot:

我想要的web浏览器看起来像蓝色区域 - 也就是填写表格,并针对窗体的边缘齐平。

I want the WebBrowser to look like the blue area -- that is, to fill the Form and be flush against the Form's edges.

推荐答案

IE借鉴,作为对body标签的默认样式的一部分。设置边界:0px body元素,它会消失。

IE draws that as part of the default style on the body tag. Set border:0px on the body element and it goes away.

值得庆幸的是,这是在IE9 要走了。

Thankfully, this is going away in IE9.