Created
March 15, 2016 10:56
-
-
Save koffisani/ea4869bcfdb1a496672a to your computer and use it in GitHub Desktop.
A brief code for openning a window after closing the first one in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OnButton1Click(object sender, EventArgs e) | |
{ | |
this.Hide(); //On cache la fenêtre courante | |
var form2 = new Form2(); //On instancie la seconde | |
form2.Closed += (s, args) => this.Close(); //On notifie à la première de se fermer au moment où la seconde se ferme | |
form2.Show(); //On affiche la seconde | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment