C# 在多个选项卡中打开网页浏览器
我如何创建选项卡 tab1 打开 samsung.com tab2 打开 hp.com ...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace browsergotosamsung
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate("http://www.samsung.com");
webBrowser2.Navigate("http://www.hp.com");
webBrowser3.Navigate("http://www.IBM.com");
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void webBrowser3_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void webBrowser2_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser2.Size
}
}
}
how can i create tab tab1 open samsung.com tab2 open hp.com ...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace browsergotosamsung
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate("http://www.samsung.com");
webBrowser2.Navigate("http://www.hp.com");
webBrowser3.Navigate("http://www.IBM.com");
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void webBrowser3_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void webBrowser2_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser2.Size
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜 WebBrowser 控件现在确实支持选项卡。您需要添加自己的 TabControl 在其中创建动态 TabPages 和您自己的底层 WebBrowser 控件:
The WebBrowser control does now support tabs, I guess. You need to add an own TabControl where you create dynamic TabPages and underlying WebBrowser controls by your own:
tabControl
并制作一个选项卡控件和一个tab pr 浏览器 webbrowser
tabControl
And make one tab control and and one tab pr browser webbrowser