您的位置:首页 > 编程语言 > C#

C# winform中 InitializeComponent()函数

2013-11-28 10:36 399 查看
 InitializeComponent()用于初始化窗体上控件。

转到它的定义函数可以看到:

private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(29, 34);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(204, 21);
this.textBox1.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();

}Form1窗体上有一个textbox1,并且设置其属性。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c#