Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

closing main window after clicking on a button that opens another window in wpf

public partial class MainWindow : Window
{
	public MainWindow() 
	{
		InitializeComponent();
	}
	private void Button_Click(object sender, RoutedEventArgs e) 
	{
		Window1 win1 = new Window1();
		win1.Show();
		this.Close();
	}
}
 
PREVIOUS NEXT
Tagged: #closing #main #window #clicking #button #opens #window #wpf
ADD COMMENT
Topic
Name
1+8 =