c#生成标签

本文关键字:标签 | 更新日期: 2023-09-27 18:03:39

我需要一些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;
}

c#生成标签

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());

试试上面的