Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Handle form closing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Etienne Charland - 28 Sep 2004 06:57 GMT
I have an MDI form containing child forms. I want to handle form closing to
display a confirmation message when a form is closed or when the main form
is closed. However, the Closing even of the child forms is raised before the
Closing event of the MDI form when you close the MDI form. So, if I catch
the Closing event of the child forms and display a message, then catch the
Closing even of the main form, then I get 2 messages displayed.

Is there a way to know, when a child form is being closed, wether the user
closed the child form or the mdi form?

Thanks
Etienne
Haim - 28 Sep 2004 09:17 GMT
The only way I can think of right now is to catch the
MouseDown event of the parent window and check to see if
the mouse position is over the close button, if it is -
you can ask for approval and disable the event if the
user choose to cancel the form close.
I am sure there is a better way but at least it gives you
a full solution.

Haim.

>-----Original Message-----
>I have an MDI form containing child forms. I want to handle form closing to
[quoted text clipped - 11 lines]
>
>.
Wiktor Zychla - 28 Sep 2004 09:29 GMT
>I have an MDI form containing child forms. I want to handle form closing to
>display a confirmation message when a form is closed or when the main form
[quoted text clipped - 5 lines]
> Is there a way to know, when a child form is being closed, wether the user
> closed the child form or the mdi form?

http://tinyurl.com/5e4c9

Wiktor Zychla

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.