Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

The X box on a form (close the form)

Posted on 2005-05-17
5
Medium Priority
?
201 Views
Last Modified: 2010-04-16
What Event fires when you click on the X in the upper right hand corner of a form?
0
Comment
Question by:Tom Knowlton
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
atxondo earned 2000 total points
ID: 14019980
closed event when form is closed.
And Closing when the form is going to close.

private void onClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
      e.Cancel = true;
}

OnClosed cannot be canceled.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 14020171
OnClosing works just fine.

I wanted to save the Form Height and Form Width before the form closed......now I can do this if the X button is clicked!!!


Thanks!!
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 14020178
What would be the purpose of OnClosed( )    ?????


What does it offer me that OnClosing does not ?
0
 
LVL 3

Expert Comment

by:atxondo
ID: 14020252
OnClosing can be used to cancel close action, but onClosed cannot be canceled
 undertand it as a option to know if the resources that you were using  has been disposed correctly.

Basically they are the same thing.

Closing -->Before Close.
Closed -->After Closed.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 14020878
Okay...that helps....thx.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question