WPF的的打开关闭

 关于WPF页面的一些打开关闭操作

//在WPF窗体中,通过第一个页面中的按钮打开第二个页面
private void Button_Click(object sender, RoutedEventArgs e)
{
    WindowForm1 wf1 = new WindowForm1();
    wf1.Show();
}

//在第二个页面中点击按钮关闭当前页面
private void btn_Add_Click(object sender, RoutedEventArgs e)
{   
    this.Close();
}

猜你喜欢

转载自blog.csdn.net/qq_35762397/article/details/81463356