public void AddMyControls()
{
TextBox textBox1 = new TextBox();
Label label1 = new Label();
// Initialize the controls and their bounds.
label1.Text = "First Name";
label1.Location = new Point(48,48);
label1.Size = new Size (104, 16);
textBox1.Text = "";
textBox1.Location = new Point(48, 64);//制定你的位置
textBox1.Size = new Size(104,16);
// Add the TextBox control to the form's control collection.
Controls.Add(textBox1);
// Add the Label control to the form's control collection.
Controls.Add(label1);
}
{
TextBox textBox1 = new TextBox();
Label label1 = new Label();
// Initialize the controls and their bounds.
label1.Text = "First Name";
label1.Location = new Point(48,48);
label1.Size = new Size (104, 16);
textBox1.Text = "";
textBox1.Location = new Point(48, 64);//制定你的位置
textBox1.Size = new Size(104,16);
// Add the TextBox control to the form's control collection.
Controls.Add(textBox1);
// Add the Label control to the form's control collection.
Controls.Add(label1);
}
"System.Web.UI.WebControls.Label”并不包含对“Location”的定义
"System.Web.UI.WebControls.Label”并不包含对“Size”的定义
我以为是winform
{
style.Remove("left");
style.Remove("top");
style.Remove("width");
style.Remove("height");
style.Add("left",left);
style.Add("top",top);
style.Add("width",width);
style.Add("height",height);
}
给控件定位:
setstyle(控件.Style,left,top,width,height);