Which event fires when Ok button is clicked?

H

Hari

Hi,

Does any one know what event is raised when i click on the close(
i.e. OK) button of a form in a PPC application? My app needs to perform
different actions based on the way the form is closed. Basically, a
form can be closed in 2 ways. First, by hitting the Ok button. Second,
by calling form.Close() programmatically. In both the cases 'closing'
and 'closed' events are raised. So i can't use any of these. What event
fires when Ok is clicked, and how to handle it? Thanks.


- Hari
 
H

Hari

Hi,

I've a problem in using Closing event. Actually in the app, I've a
mainMenuitem "LogoffAllSessions" which when clicked shows a dialog if
the user want to really disconnect from all the sessions. And i want
exactly the same to be done when i hit the Ok button. If the user
selects "No" from the dialog, the form should not be closed. But if i
put the code in closing, how can i stop the Form from closing? Any
solution or a new way?? Thanks a lot.


- Hari
 
G

Guest

The Closing method takes in a CancelEventArgs. Set e.Cancel = true and the
form won't close.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top