繁体   English   中英

Visual Studio 2019 Community 工具箱没有 webbrowser 控件

[英]Visual Studio 2019 Community toolbox has no webbrowser control

我的 Visual Studio 工具箱

我有一个 WinForms 应用程序,当我设计一个表单时,工具箱没有显示 webbrowser 控件。 框架是.NET 5.0。 我使用的是Visual Studio 2019 Community最新版本v16.8.6,如截图所示。

谁能帮我?

WebBrowser 控件已过时,难以正确呈现大多数现代网站。 我会推荐使用 WebView2 而不是https://docs.microsoft.com/microsoft-edge/webview2/get-started/winforms

我有 VS 2022 和 .NET 6.0,它也不在工具箱中。 我能够通过编辑 MyForm.Designer.cs 文件来添加它。 我向文件的 4 个部分添加了代码。 this.webBrowser1 = new System.Windows.Forms.WebBrowser();

        // 
        // webBrowser1
        // 
        this.webBrowser1.Location = new System.Drawing.Point(1064, 24);
        this.webBrowser1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3);
        this.webBrowser1.MinimumSize = new System.Drawing.Size(27, 27);
        this.webBrowser1.Name = "webBrowser1";
        this.webBrowser1.Size = new System.Drawing.Size(405, 506);
        this.webBrowser1.TabIndex = 27;

this.Controls.Add(this.webBrowser1);

私人系统.Windows.Forms.WebBrowser webBrowser1;

超级...适合我

this.webBrowser1 = new System.Windows.Forms.WebBrowser();

    // 
    // webBrowser1
    // 
    this.webBrowser1.Location = new System.Drawing.Point(1064, 24);
    this.webBrowser1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3);
    this.webBrowser1.MinimumSize = new System.Drawing.Size(27, 27);
    this.webBrowser1.Name = "webBrowser1";
    this.webBrowser1.Size = new System.Drawing.Size(405, 506);
    this.webBrowser1.TabIndex = 27;

this.Controls.Add(this.webBrowser1);

私人系统.Windows.Forms.WebBrowser webBrowser1;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM