Removing border from WebBrowser control

前端 未结 4 1079
半阙折子戏
半阙折子戏 2021-01-18 17:25

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

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-18 17:28

    I cannot reproduce the appearance you are telling about. My code in the Form1.Designer.cs is:

        this.webBrowser1.Location = new System.Drawing.Point(0, 0);
        this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
        this.webBrowser1.Name = "webBrowser1";
        this.webBrowser1.ScrollBarsEnabled = false;
        this.webBrowser1.Size = new System.Drawing.Size(141, 125);
        this.webBrowser1.TabIndex = 0;
        this.webBrowser1.Uri = ....
    

    and the webcontrol is shown without the border... I'm using VS 2008 SP1/Windows 7.

    Maybe you should try to add the control inside a container, e.g. a panel.

提交回复
热议问题