日期:2014-05-19  浏览次数:20751 次

登陆窗口问题(可用分只10分)
LOGIN   窗体
MAIN   窗体

设置LOGIN   窗体为程序启动入口:

///   <summary>
///   应用程序的主入口点。
///   </summary>
[STAThread]
static   void   Main()  
{
Application.Run(new   LOGIN());
}


if(myDr.Read())
{
MAIN   m=new   MAIN();
m.ShowDialog();
this.Close();
}
else
{
MessageBox.Show( "此用户不存在 ");
}

无法关闭LOGIN窗口(逻辑问题,只有在等待MAIN窗体关闭后LOGIN才能关闭)..


设置MAIN窗体为程序启动入口:
///   <summary>
///   应用程序的主入口点。
///   </summary>
[STAThread]
static   void   Main()  
{
Application.Run(new   MAIN());
}


InitializeComponent();

//
//   TODO:   在   InitializeComponent   调用后添加任何构造函数代码
//

LOGIN   lg=new   LOGIN();
lg.ShowDialog();
                                                        this.Hide();
//////////////登陆端:
if(myDr.Read())
{
this.Close();
}
else
{
MessageBox.Show( "此用户不存在 ");
}


不管成功与否都将转到,MAIN窗体...

请问大家如何解决这问题..


------解决方案--------------------
说说你想干吗