Home
Manage Your Code
Snippet: Avoid Shutdown of a Win-Application if 'x' is pressed (C#)
Title: Avoid Shutdown of a Win-Application if 'x' is pressed Language: C#
Description: This short code avoid a Shutdown of a Win-Application if the 'x' Button is pressed. You need only one line of Code in the FormClosing Event. Views: 112
Author: Frank Blau Date Added: 7/29/2008
Copy Code  
1private void Form1_FormClosing(object sender, FormClosingEventArgs e)
2{
3  e.Cancel = true;
4}
5