C#winform 如何实现主窗体关闭并且要子窗体显示出来。必须关闭主窗体!谢谢!
rt,谢谢。最后关闭子窗体还是需要显示主窗体的。
[解决办法]
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
ShowChildForm();
}
public static Form ChildForm;
static void ShowChildForm()
{
if (ChildForm != null && (ChildForm.GetType().Name == "Form1"
[解决办法]
ChildForm.GetType().Name == "Form2"))
{
Application.Run(ChildForm);
ShowChildForm();
}
}
}