怎么样使用控件的Created属性?

ghosthu 2005-03-20 08:31:51
我写了一个简单的程序,试想测试控件的Created属性。程序如下
using System;
using System.Windows.Forms;
namespace test_created
{
/// <summary>
/// Summary description for Class1
/// </summary>
public class Class1
{
public static void Main()
{
Form form = new Form();
form.Text = "TEST";
Button button = new Button();
button.Text = "confirm";
form.Controls.Add(button);
if (button.Created)
{
Label label = new Label();
label.Text = "button is created";
label.AutoSize = true;
form.Controls.Add(label);

}

Application.Run(form);

}
}
}
编译是没有问题的。但没有我想要的结果。请教
...全文
36 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧