Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ochilab
Created March 7, 2014 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochilab/9406756 to your computer and use it in GitHub Desktop.
Save ochilab/9406756 to your computer and use it in GitHub Desktop.
C#: フォームのクローズボタンが押された場合の処理。このイベントは追加すること。
void Form1_FormClosing(object sender, FormClosingEventArgs e){
DialogResult result = MessageBox.Show("終了しますか?", "システム終了",MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No){
e.Cancel = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment