Can you override a forms controlbox events?

F

Flashster

I have an exit routine that runs when a users selects 'exit' from a menu or
closes the form by clicking on the 'X' in the top right of the form (on the
controlbox).

One option in the exit routine will be to cancel the closing of the form
(i.e. oops I didn't mean to click that..). How would I cancel this event?
 
S

steve

| One option in the exit routine will be to cancel the closing of the form
| (i.e. oops I didn't mean to click that..). How would I cancel this event?

oh yeah...that would be...RTFM
 
H

Herfried K. Wagner [MVP]

steve said:
| One option in the exit routine will be to cancel the closing of the form
| (i.e. oops I didn't mean to click that..). How would I cancel this
event?

oh yeah...that would be...RTFM


Steve, friendly as ever...
 
H

Herfried K. Wagner [MVP]

Flashster said:
I have an exit routine that runs when a users selects 'exit' from a menu or
closes the form by clicking on the 'X' in the top right of the form (on the
controlbox).

One option in the exit routine will be to cancel the closing of the form
(i.e. oops I didn't mean to click that..). How would I cancel this event?

Handle the form's 'Closing' event and set 'e.Cancel' to 'True' if you want
to prevent the form from closing.
 
F

Flashster

Thank you. I'd got as far as handling the Closing event but have been trying
to work out for some time today how to stop the form/app closing. Cleary
being a beginner is inexcusable.

Thanks again Herfried.
 
F

Flashster

What may be trivial to you is not to me, at least not in this subject. And I
have consulted the manual. If my questions are annoying to you, then please
ignore them.
 
S

steve

| Thank you. I'd got as far as handling the Closing event but have been
trying
| to work out for some time today how to stop the form/app closing. Cleary
| being a beginner is inexcusable.

well...that WAS in the fm, sdks, included samples, and google for christ's
sake. glancing at tfm is not the same as Rtfm..."cleary" being illiterate is
inexcusable. ;^)
 
F

Flashster

:-O

As I've said - if my trivial questions bother you steve, please ignore them.
 
D

Dachshund Digital

To the guy that said "RTFM", what is the purpose of that? OF COURSE 99%
of the answers are in the documentation... but.... the documentation is
sometimes 1) hard to find the right info, 2) is not always
understandable based on skill or talent of coding, 3) for some things
it takes someone to explain it for it to click! That is WHAT THIS FORM
IS FOR. And yes I often yell RTFM to my peers in our coding shop...
BUT I always make sure they FIND IT and UNDERSTAND IT. What good if
RTFM, if they do not improve over time? Just a thought.
 
S

steve

| To the guy that said "RTFM", what is the purpose of that? OF COURSE 99%
| of the answers are in the documentation... but.... the documentation is
| sometimes 1) hard to find the right info, 2) is not always
| understandable based on skill or talent of coding, 3) for some things
| it takes someone to explain it for it to click! That is WHAT THIS FORM
| IS FOR. And yes I often yell RTFM to my peers in our coding shop...
| BUT I always make sure they FIND IT and UNDERSTAND IT. What good if
| RTFM, if they do not improve over time? Just a thought.


if you have a "coding shop" and you have to "often" yell rtfm, you need to
rehire.

as for the help files, that's only one stop in the search for an answer.
canceling a form's closing event is BASIC functionality...and is WIDELY
covered not only in help but also in the sample applications installed with
visual studio .net and extensively prevalent on the web.

how hard is it to google:

"vb.net cancel form close"

wow, the first link shows how...and the second, and third, and...ad-nausium.

i DON'T often yell rtfm...but certainly DO when ABSOLUTELY warranted!!!

and btw, 99% of what NEW developers want is in the help files while 99% of
mid and senior-level developers quandries will NOT be found therein. imho, i
think this forum would better be served by addressing THOSE questions by
people who have figured out the answers...as most have been discovered and
solved through inference and experience - which is something manuals cannot
provide. this is not something that CAN improve with time. it is just the
nature of documentation...just a thought.

imo, it is a diservice to ask questions that obviously show a lack of effort
in finding answers that are easily found and readily available. you and i
simply have differing perspectives. i haven't railed you for yours...perhaps
you should revisit understanding mine.
 
D

Dachshund Digital

I think you misunderstand the voluntary nature of groups, if you don't
like the fact that people ask questions, don't read the group messages?
Yes, I hate it when I see obvious questions... But they are only
obvious if you already know the answer. Some people share, some don't,
some look for the answer, some don't. I would rather given someone
help, because some day they may help me.
 
D

Dachshund Digital

I think you misunderstand the voluntary nature of groups, if you don't
like the fact that people ask questions, don't read the group messages?
Yes, I hate it when I see obvious questions... But they are only
obvious if you already know the answer. Some people share, some don't,
some look for the answer, some don't. I would rather given someone
help, because some day they may help me.
 

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