1. When the program exits, a dialog box is displayed for the user to confirm (record the position and size of the window when the last program is running)
Add the closing and closed event handling methods for the corresponding form
Private void form1_closing (Object sender, system. componentmodel. canceleventargs E)
{
Dialogresult res = MessageBox. Show ("are you sure you want to exit? "," Exit ", messageboxbuttons. yesno );
E. Cancel = (RES = dialogresult. No );
}
Private void formpolicclosed (Object sender, system. eventargs E)
{
MessageBox. Show ("Thank you for using ");
}
Note: In the closing or closed event processing method, it can be used to record the status of the form for future use (such as the current window position and size)
2. Various sizes and locations in Form
Clientsize does not include title bars, borders, etc.
The specified toplocation does not contain the taskbar.
Bytes --------------------------------------------------------------------------------------------------------------
PS: Today is the Lantern Festival, where the firecrackers are outside ):).Windows Forms programming in C #(AuthorChris sells, Addison Wesley press, 2003.8.),I am reading an English CHM electronic version, which is also my first seriousReadI think this book is really good, and it is clear and easy to understand. Examples and explanations are also excellent. (Read this book to prepare for completing the assignment of the object-oriented technology course this semester. It is estimated that most people will c ++ and a few Java, C # Should look special ^_^)