Tag Archives: FormClosing

Safely manage documents in C#

This is a pretty involved example that shows how to safely manage documents. The pieces are all simple but there are a lot of tightly integrated pieces. This example lets you create, edit, open, and save files in text and … Continue reading

Posted in files, forms, user interface | Tagged , , , , , , , , , , , , , , , , | 1 Comment

Display reusable dialog forms in C#

The example Make a dialog with standard dialog features in C# shows the most common approach to making dialogs. Whenever it needs to display the dialog, the main program initializes a new instance of it and displays it. If the … Continue reading

Posted in dialogs, user interface | Tagged , , , , , , , , , , , | Leave a comment

Make a form fade out until it disappears in C#, Part 2

The example Make a form fade out until it disappears in C# makes a form fade out when the user clicks the form’s Close button, but there are several other ways the user can close the form without it fading … Continue reading

Posted in forms, user interface | Tagged , , , , , , , , , , , , | Leave a comment

Learn why a form is closing in C#

You can learn why a form is closing by using the form’s FormClosing event handler. The event handler’s e parameter has a property CloseReason that tells you why the form is closing. The CloseReason can be one of the following … Continue reading

Posted in forms | Tagged , , , , , , , , | Leave a comment