Lạ nhỉ, em dùng Object Browser tìm thì chỉ thấy có Form và PropertyGrid là có tập hợp Controls thôi mà. Em đã tạo thử cái panel và 3 cái textbox trên đó, tuy nhiên trong phần khởi tạo của Form không hề thấy có dòng nào add 3 cái textbox đó vào Controls của Panel cả
PHP Code:
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox5 = new System.Windows.Forms.TextBox();
this.textBox6 = new System.Windows.Forms.TextBox();
this.textBox7 = new System.Windows.Forms.TextBox();
this.textBox8 = new System.Windows.Forms.TextBox();
this.textBox9 = new System.Windows.Forms.TextBox();
this.textBox10 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.textBox11 = new System.Windows.Forms.TextBox();
this.textBox12 = new System.Windows.Forms.TextBox();
this.textBox13 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(104, 48);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(144, 20);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "textBox1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(88, 96);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(144, 20);
this.textBox2.TabIndex = 1;
this.textBox2.Text = "textBox2";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(24, 80);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(144, 20);
this.textBox3.TabIndex = 2;
this.textBox3.Text = "textBox3";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(90, 139);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(144, 20);
this.textBox4.TabIndex = 3;
this.textBox4.Text = "textBox4";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(-8, 176);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(144, 20);
this.textBox5.TabIndex = 4;
this.textBox5.Text = "textBox5";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(-8, 216);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(144, 20);
this.textBox6.TabIndex = 5;
this.textBox6.Text = "textBox6";
//
// textBox7
//
this.textBox7.Location = new System.Drawing.Point(114, 163);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(144, 20);
this.textBox7.TabIndex = 6;
this.textBox7.Text = "textBox7";
//
// textBox8
//
this.textBox8.Location = new System.Drawing.Point(122, 171);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(144, 20);
this.textBox8.TabIndex = 7;
this.textBox8.Text = "textBox8";
//
// textBox9
//
this.textBox9.Location = new System.Drawing.Point(130, 179);
this.textBox9.Name = "textBox9";
this.textBox9.Size = new System.Drawing.Size(144, 20);
this.textBox9.TabIndex = 8;
this.textBox9.Text = "textBox9";
//
// textBox10
//
this.textBox10.Location = new System.Drawing.Point(152, 224);
this.textBox10.Name = "textBox10";
this.textBox10.Size = new System.Drawing.Size(144, 20);
this.textBox10.TabIndex = 9;
this.textBox10.Text = "textBox10";
//
// button1
//
this.button1.Location = new System.Drawing.Point(64, 16);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(104, 16);
this.button1.TabIndex = 10;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// panel1
//
this.panel1.Controls.Add(this.textBox13);
this.panel1.Controls.Add(this.textBox12);
this.panel1.Controls.Add(this.textBox11);
this.panel1.Location = new System.Drawing.Point(64, 80);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(176, 152);
this.panel1.TabIndex = 11;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// textBox11
//
this.textBox11.Location = new System.Drawing.Point(16, 66);
this.textBox11.Name = "textBox11";
this.textBox11.Size = new System.Drawing.Size(144, 20);
this.textBox11.TabIndex = 6;
this.textBox11.Text = "textBox11";
//
// textBox12
//
this.textBox12.Location = new System.Drawing.Point(40, 120);
this.textBox12.Name = "textBox12";
this.textBox12.Size = new System.Drawing.Size(144, 20);
this.textBox12.TabIndex = 7;
this.textBox12.Text = "textBox12";
//
// textBox13
//
this.textBox13.Location = new System.Drawing.Point(24, 8);
this.textBox13.Name = "textBox13";
this.textBox13.Size = new System.Drawing.Size(144, 20);
this.textBox13.TabIndex = 8;
this.textBox13.Text = "textBox13";
//
// button2
//
this.button2.Location = new System.Drawing.Point(184, 16);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(104, 24);
this.button2.TabIndex = 12;
this.button2.Text = "button2";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox10);
this.Controls.Add(this.textBox9);
this.Controls.Add(this.textBox8);
this.Controls.Add(this.textBox7);
this.Controls.Add(this.textBox6);
this.Controls.Add(this.textBox5);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
Em thêm cả một button nữa, tuy rằng thằng này không có tâp hợp Controls nhưng khi truy nhập tới cũng chẳng báo lỗi. Nhưng chương trình của anh thì vẫn chạy đúng. Chẳng hiểu thế nào nữa.?