[求助]关闭MDI窗体,重新登陆的问题???(有附件)
方法一:Login lg = new Login();
if (lg.ShowDialog() == DialogResult.OK)
{
Form[] fr = this.MdiChildren;
if (fr.Length != 0)
{
foreach (Form fm in fr)
{
fm.Close();
}
}
FrMain_Load(sender, e);
}
方法二:利用线程实现重新登陆
bool ExitApp = false;
Login lg = new Login();
ExitApp = false;
if (!ExitApp)
{
if (lg.ShowDialog() == DialogResult.OK)
{
Thread thr = new Thread(new ThreadStart(FrmStart));
thr.Start();
Application.Exit();
//FrMain fm = new FrMain();
//Application.Run(fm);//真正退出系统时,关闭主窗口之前置ExitApp的值为true,否则置false;
}
else
ExitApp = true;
}
方法三:我想关闭MDI主窗体后,弹出登陆窗体.以达到重新登陆的目的????
if (MessageBox.Show(this, "你真的退出系统并重新登陆吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
{
???????????????????????????????????????????????????????
Login frlogin = new Login();
frlogin.ShowDialog();
}
else
{
return;
}
我想做的是关闭MDI主窗体后,弹出登陆窗体.以达到重新登陆的目的????
望高手帮忙
[此贴子已经被作者于2007-6-13 14:45:44编辑过]