private void btnchoilai_Click(object sender, RoutedEventArgs e) { //để xác định chơi lại màng nào switch (mangchoi) { case 1: { MainWindow mang1 = new MainWindow(); Thread t_dongform = new Thread(dongform); t_dongform.IsBackground = true; t_dongform.Start(); mang1.ShowDialog(); break; } case 2: { Mang2 mang2 = new Mang2(); Thread t_dongform = new Thread(dongform); t_dongform.IsBackground = true; t_dongform.Start(); mang2.ShowDialog(); break; } case 3: { Mang3 mang3 = new Mang3(); Thread t_dongform = new Thread(dongform); t_dongform.IsBackground = true; t_dongform.Start(); mang3.ShowDialog(); break; } case 4: { Mang4 mang4 = new Mang4(); Thread t_dongform = new Thread(dongform); t_dongform.IsBackground = true; t_dongform.Start(); mang4.ShowDialog(); break; } } }
private void btnchotiep_Click(object sender, RoutedEventArgs e) { // Xác định chơi tiếp màng nào switch (mangchoi) { case 1: { Mang2 mang2 = new Mang2(); Thread t_dongform = new Thread(dongform); t_dongform.IsBackground = true; t_dongform.Start(); mang2.ShowDialog(); break; } case 2: { Mang3 mang3 = new Mang3(); Thread t_dongform = new Thread(dongform); t_dongform.IsBackground = true; t_dongform.Start(); mang3.ShowDialog(); break; } case 3: { Mang4 mang4 = new Mang4(); Thread t_dongform = new Thread(dongform); t_dongform.IsBackground = true; t_dongform.Start(); mang4.ShowDialog(); break; } case 4: { MessageBox.Show("Mình làm có 4 màng chơi hà. :D "); break; } } }