标签:
using System.Windows.Forms; namespace Keleyi.Com { public partial class AboutForm : Form { private static AboutForm _instance; private AboutForm() { InitializeComponent(); } private void AboutForm_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason== CloseReason.UserClosing) { this.Hide(); e.Cancel = true; } } public static AboutForm GetInstance() { if (_instance == null) _instance = new AboutForm(); return _instance; } } }
构造函数私有化,声明静态窗体变量
标签:
原文地址:http://www.cnblogs.com/wxlyq/p/5178435.html