Close Parent Window when Opening Child Window

After executing ShowDialog(), the following code will not be executed before closing the child window.

复制代码
public partial class Parent : System.Windows.Forms.Form
{
    public Parent()
    {
        InitializeComponent();
    }
    private void toChild_Click(object sender, EventArgs e)
    {
        Child child = new Child();
        this.Hide();
        child.ShowDialog();
        this.Close();
    }
}
复制代码
posted @   Kyle0418  阅读(167)  评论(5编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示