I have a WinForms app, when I design a form, the toolbox shows no webbrowser control. The framework is .NET 5.0. I use Visual Studio 2019 Community latest version v16.8.6, as shown in the screenshot.
Can anyone help me?
The WebBrowser control is outdated and struggles to render most modern websites proprely. I would recomment using WebView2 instead https://docs.microsoft.com/microsoft-edge/webview2/get-started/winforms
I have VS 2022 and .NET 6.0 and it is not in the toolbox there either. I was able to add it by editing the MyForm.Designer.cs file. There are 4 sections of the file that I added code to. 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);
private System.Windows.Forms.WebBrowser webBrowser1;
super...works for me
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);
private System.Windows.Forms.WebBrowser webBrowser1;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.