| | |
Closed event of a form
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2005
Posts: 20
Reputation:
Solved Threads: 1
I have a problem, with a closed form event.
I'd like to make a check with a click on close botton in the title bar that check if the user are sure or not to close the application.
I have made a method that ask if the user are sure when click on the X in the title bar but when the user select the no option what must I do to evitate that the application was closed??
Thanks a lot for the help.
I'd like to make a check with a click on close botton in the title bar that check if the user are sure or not to close the application.
I have made a method that ask if the user are sure when click on the X in the title bar but when the user select the no option what must I do to evitate that the application was closed??
Thanks a lot for the help.
•
•
Join Date: May 2005
Posts: 20
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by campkev
could you ask that again in english?
I have made a windows form application.
My application is a Mdicontainer with many child form.
I want to check che closed event of this form, and when happend i want to intercept it and ask a confermation of closing application.
This part I don't have problem to implement.
My problem is the messagebox that ask if the user want really to close (Yes/No).
I have made a method that check if the Dialog result is Yes or no, but when the result it's no, want i can do to stopping the closing operation of the application??
Thanks a lot.
•
•
Join Date: Jul 2005
Posts: 483
Reputation:
Solved Threads: 19
C# Syntax (Toggle Plain Text)
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if(MessageBox.Show("Are you sure you want to close?", "Closing Program", MessageBoxButtons.OKCancel) == DialogResult.Cancel) e.Cancel = true; }
![]() |
Similar Threads
- maximizing form (Visual Basic 4 / 5 / 6)
- Form1.KeyDown Event Problems (VB.NET)
- Populating a fields on a form base on a selected item from a droplist. (PHP)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: opening programs
- Next Thread: C# 2005 - ComboBoxes with Parent / Child relation in DataGridView
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast buttons c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset date/time datetime degrees development draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update upload usercontrol users validate validation visualstudio webbrowser windows winforms wpf xml





