C#生成标签

时间:2014-05-15 17:30:29

标签: c#

我需要在生成的事情上为C#提供一些帮助。

我尝试过它并没有奏效。继承我的代码:

public static void MakeNewLabel()
{
   Label myLabel = new Label();
   myLabel.Name = "myLabelName";
   myLabel.Text = "";
   myLabel.Location = new Point(13, min_char + 3);
   myLabel.Visible = true;
}

1 个答案:

答案 0 :(得分:0)

public static Label MakeNewLabel()
{
   Label myLabel = new Label();
   myLabel.Name = "myLabelName";
   myLabel.Text = "";
   myLabel.Location = new Point(13, min_char + 3);
   myLabel.Visible = true;
   return myLabel;
}


this.Controls.Add(MakeNewLabel());

试试上面的