在一个winForm项目中,怎么添加一个网面?还有就是添加浮动标签,就像遨游,360的网页标签一样,求指教,谢谢!
1 namespace WindowsFormsApplication1
2 {
3 partial class Form1
4 {
5 /// <summary>
6 /// 必需的设计器变量。
7 /// </summary>
8 private System.ComponentModel.IContainer components = null;
9
10 /// <summary>
11 /// 清理所有正在使用的资源。
12 /// </summary>
13 /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
14 protected override void Dispose(bool disposing)
15 {
16 if (disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }
22
23 #region Windows 窗体设计器生成的代码
24
25 /// <summary>
26 /// 设计器支持所需的方法 - 不要
27 /// 使用代码编辑器修改此方法的内容。
28 /// </summary>
29 private void InitializeComponent()
30 {
31 this.tabControl1 = new System.Windows.Forms.TabControl();
32 this.tabPage1 = new System.Windows.Forms.TabPage();
33 this.tabPage2 = new System.Windows.Forms.TabPage();
34 this.webBrowser1 = new System.Windows.Forms.WebBrowser();
35 this.webBrowser2 = new System.Windows.Forms.WebBrowser();
36 this.tabControl1.SuspendLayout();
37 this.tabPage1.SuspendLayout();
38 this.tabPage2.SuspendLayout();
39 this.SuspendLayout();
40 //
41 // tabControl1
42 //
43 this.tabControl1.Controls.Add(this.tabPage1);
44 this.tabControl1.Controls.Add(this.tabPage2);
45 this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
46 this.tabControl1.Location = new System.Drawing.Point(0, 0);
47 this.tabControl1.Name = "tabControl1";
48 this.tabControl1.SelectedIndex = 0;
49 this.tabControl1.Size = new System.Drawing.Size(292, 266);
50 this.tabControl1.TabIndex = 1;
51 //
52 // tabPage1
53 //
54 this.tabPage1.Controls.Add(this.webBrowser1);
55 this.tabPage1.Location = new System.Drawing.Point(4, 21);
56 this.tabPage1.Name = "tabPage1";
57 this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
58 this.tabPage1.Size = new System.Drawing.Size(243, 180);
59 this.tabPage1.TabIndex = 0;
60 this.tabPage1.Text = "百度";
61 this.tabPage1.UseVisualStyleBackColor = true;
62 this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
63 //
64 // tabPage2
65 //
66 this.tabPage2.Controls.Add(this.webBrowser2);
67 this.tabPage2.Location = new System.Drawing.Point(4, 21);
68 this.tabPage2.Name = "tabPage2";
69 this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
70 this.tabPage2.Size = new System.Drawing.Size(284, 241);
71 this.tabPage2.TabIndex = 1;
72 this.tabPage2.Text = "谷歌";
73 this.tabPage2.UseVisualStyleBackColor = true;
74 //
75 // webBrowser1
76 //
77 this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
78 this.webBrowser1.Location = new System.Drawing.Point(3, 3);
79 this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
80 this.webBrowser1.Name = "webBrowser1";
81 this.webBrowser1.Size = new System.Drawing.Size(237, 174);
82 this.webBrowser1.TabIndex = 1;
83 this.webBrowser1.Url = new System.Uri("http://www.baidu.com/", System.UriKind.Absolute);
84 //
85 // webBrowser2
86 //
87 this.webBrowser2.Dock = System.Windows.Forms.DockStyle.Fill;
88 this.webBrowser2.Location = new System.Drawing.Point(3, 3);
89 this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20);
90 this.webBrowser2.Name = "webBrowser2";
91 this.webBrowser2.Size = new System.Drawing.Size(278, 235);
92 this.webBrowser2.TabIndex = 2;
93 this.webBrowser2.Url = new System.Uri("http://www.google.com.hk/webhp?hl=zh-cn&tab=Tw", System.UriKind.Absolute);
94 //
95 // Form1
96 //
97 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
98 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
99 this.ClientSize = new System.Drawing.Size(292, 266);
100 this.Controls.Add(this.tabControl1);
101 this.Name = "Form1";
102 this.Text = "Form1";
103 this.tabControl1.ResumeLayout(false);
104 this.tabPage1.ResumeLayout(false);
105 this.tabPage2.ResumeLayout(false);
106 this.ResumeLayout(false);
107
108 }
109
110 #endregion
111
112 private System.Windows.Forms.TabControl tabControl1;
113 private System.Windows.Forms.TabPage tabPage1;
114 private System.Windows.Forms.TabPage tabPage2;
115 private System.Windows.Forms.WebBrowser webBrowser1;
116 private System.Windows.Forms.WebBrowser webBrowser2;
117
118 }
119 }
WebBrowser控件
WebBrowser控件就可以。
微软提供了WebBrowser控件就可以了的
WebBrowser
用WebBrowser控件