Search for
in snippet title/description
in snippet text
Browse Code
Add-Ins
Blog
Language Feeds
Service Stats
FAQs
Feedback
About
Manage Your Code
Login
Register
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
1
private
void
Form1_FormClosing(
object
sender, FormClosingEventArgs e)
2
{
3
e.Cancel =
true
;
4
}
5
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; }