/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//这是登录窗体,ShowDialog的方式。dialog返回OK,则显示:ComListForm主窗体。
Login form1 = new Login();
form1.ShowDialog();
if (form1.DialogResult == DialogResult.OK)
{
Application.Run(new ComListForm());
}
else
{
return;
}
//Application.Run(new ComListForm());
}
在登录按钮click事件中:
登录成功,执行:
this.DialogResult = DialogResult.OK;
this.Close();
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。