我在一个解决方案中有2个项目,我的主要项目是项目1,在项目期间1个主要表单加载事件我从项目2运行一个表单,我的问题是如何在表单之后显示项目1中的表单项目2结束了吗?
//Here is the form from project 2 will run on project 1 mains form load
pp2.FormLoader frmLdr = new pp2.FormLoader();
frmLdr.MdiParent = this;
frmLdr.Show();
//the form from project 2 will automatically closes after a couple of seconds, after that this form should be automatically show. How can I possibly do this? Thanks!
FormProcess frmSvrProc = new FormProcess();
frmSvrProc.MdiParent = this;
frmSvrProc.Show();
答案 0 :(得分:2)
现在我理解你的问题(除了你应该真正重命名那个表格之外)
您可以订阅frmLdr
pp2.Loader frmLdr = new pp2.Loader();
frmLdr.MdiParent = this;
frmLdr.FormClosed += new FormClosedEventHandler(frmLdrClosed);
frmLdr.Show();
....
并移动在事件处理程序
中打开第二个表单的代码 private void frmLdrClosed(object sender, System.EventArgs e)
{
FormProcess frmSvrProc = new FormProcess();
frmSvrProc.MdiParent = this;
frmSvrProc.Show();
}