问题描述
if(myreader.Read()){MainfromMainfrom=newMainfrom();loginloginfrom=newlogin();loginfrom.Close();Mainfrom.Show();return;}mainfrom窗体能打开,但是loginfrom窗体却关闭不了。loginloginfrom=newlogin();loginfrom.Close();上面两句话写错了吗?
解决方案
解决方案二:
loginloginfrom=newlogin();loginfrom.Hide();
解决方案三:
if(myreader.Read()){MainfromMainfrom=newMainfrom();loginloginfrom=newlogin();DialogResultrs=loginfrom.ShowDialog();if(rs==DialogResult.OK){loginfrom.Hide();Mainfrom.Show();}return;}
时间: 2024-11-03 08:27:57