能否给一段代码?谢谢

解决方案 »

  1.   

    那你就利用你的窗体的Form.Controls.Add(Label)就好,利用for 循环,把每个label的坐标设置好就ok
      

  2.   

    很简单,看一下 
           private void button1_Click(object sender, EventArgs e)
            {
                Label label1 = null;
                
                int top = 7, left = 12;
                
                for (int i = 0; i < 100; i++)
                {
                    label1 = new Label();
                    label1.AutoSize = true;
                    //Label的位置
                    label1.Location = new System.Drawing.Point(left,top);
                    //Label的名字
                    label1.Name = "label" + i.ToString();
                    //Label的宽、高
                    label1.Size = new System.Drawing.Size(41, 12);
                    label1.TabIndex = i;
                    //Label显示文字
                    label1.Text = i.ToString();
                    //添加Label控件到窗体
                    this.Controls.Add(label1);
                    //Label的上边界
                    top += 12;
                }
            }