在MDI窗口中, 生成子窗口时, 有些子窗口只想让它某一时刻只生成一个实例
改变类的结构来实现
改变类的结构来实现
public partial class winform1 : Form
{
public static winform1 create;
private winform1()
{
InitializeComponent();
}
public static winform1 Create
{
get
{
if (create == null)
{
create = new winform1();
}
return create;
}
}
}
{
public static winform1 create;
private winform1()
{
InitializeComponent();
}
public static winform1 Create
{
get
{
if (create == null)
{
create = new winform1();
}
return create;
}
}
}