| | |
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 |
Tag cloud for C#
.net access ado.net algorithm array bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation visualstudio webbrowser windows winforms wpf xml





