Closing form Problem

S

savvaschr

Hello
I would like to ask what is the "correct" way to show and then to
close a form.

In my application some forms I show them with the .show event and
other
with the .ShowDialog .. but if the user press the X button on the form
the form is not
closing and I ve try to put a breakpoint in the closing event but the
event dont rise when the X button is clicked.
The only way i found is to put a button on the screen and in the click
event of the button execute me.close, but i dont want to put an extra
button in each form, and i dont know how to prevent a user from
clicking the X button of the screen.

So what can i do??
Shall i display the forms as .Showdialog and close them on the
..ondeactivate event?
Or is there another way of closing them.
Thanks a lot
Savvas
 
J

Joseph Byrns

If you set the MinimizeBox property of the form to false, it will always
have an OK button instead of the X.
 

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