| | |
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 asp barchart bitmap box broadcast buttons c# check checkbox client column combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development display draganddrop drawing encryption enum equation event excel file form format formbox forms formupdate function gdi+ httpwebrequest image index input install java label linux list listbox mandelbrot math mouseclick mysql networking operator packaging parse path photoshop picturebox pixelinversion post powerpacks programming radians regex remote remoting reporting richtextbox robot server sleep socket sql statistics stream string table text textbox thread time timer transform treeview update usercontrol validation visualstudio webbrowser wfa windows winforms wpf xml





