private static Window1 newForm;//全局实例化窗口
private void Button_Click(object sender, RoutedEventArgs e)
{
//Window1 window1 = new Window1();
//window1.Show();
if (newForm == null || newForm.IsVisible==false)
{
newForm = new Window1();
newForm.Show();
}
else
{
newForm.WindowState = WindowState.Normal;
newForm.Activate();
}
}
网友评论