Prevent a form from being disposed

  • Thread starter Thread starter Shadowboxer
  • Start date Start date
S

Shadowboxer

How do I prevent a for from being disposed of when you click the 'X' button.

I'd like to override the dispose method somehow so it just does a me.hide

any ideas? thanks -J
 
Hi Shadowboxer,
I think the best methode is to set the control box from the form to false.
And to add a button.
I'v never seen users who like strange behaviour from a form.
Just a thoughts,
Cor
 
Clicking the X and having a form disappear doesn't seem strange to me....

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Chaos, Panic, Disorder, my work here is done"


: Hi Shadowboxer,
: I think the best methode is to set the control box from the form to false.
: And to add a button.
: I'v never seen users who like strange behaviour from a form.
: Just a thoughts,
: Cor
:
:
 
Shadowboxer,
You could handle the Closing event to do something different. Such as
me.hide & setting e.Cancel to true.

The problem then becomes how to determine if the X was clicked or the
Form.Close method was called. I don't believe you can without extra code.

By the time you get to the dispose method it is too late to stop it.

Hope this helps
Jay
 
Tom,
But that in than stays in memory and will be strange, you close it and it
stays in the taskmanager.
What does it become a service?
Oh hell a virus!!!!!!!!!!!!

I see it before me,
:-))
Cor
 
Yes, a service, perhaps it has a NotifyIcon control on it.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Chaos, Panic, Disorder, my work here is done"


: Tom,
: But that in than stays in memory and will be strange, you close it and it
: stays in the taskmanager.
: What does it become a service?
: Oh hell a virus!!!!!!!!!!!!
:
: I see it before me,
: :-))
: Cor
:
:
 
Hello,

Cor said:
I think the best methode is to set the control box from the form to false.
And to add a button.
I'v never seen users who like strange behaviour from a form.

I _hate_ forms without control box.
 
Back
Top