473,325 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Prevent a form from being disposed

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
Nov 20 '05 #1
7 3479
Cor
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
Nov 20 '05 #2
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"
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader22.wxs.nl...
: 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
:
:
Nov 20 '05 #3
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

"Shadowboxer" <sh*********@mac.com> wrote in message
news:9W********************@giganews.com...
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

Nov 20 '05 #4
Cor
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
Nov 20 '05 #5
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"
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader22.wxs.nl...
: 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
:
:
Nov 20 '05 #6
Hello,

"Cor" <no*@non.com> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7
Cor
Herfried,

I _hate_ forms without control box.

I hate forms that I cannot close with a control box

Cor

Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sean Connery | last post by:
I have a Microsoft UI Process Application Block that is controlling child forms in an MDI parent container. The views node in the app.config file has been set to stayOpen=false. Because there...
2
by: Snuyt | last post by:
Hallo, when a form is closed by clicking the closing button (cross in the right upper corner of the form), it is also disposed. Can I prevent this, and instead of closing (and disposing) the...
7
by: Boni | last post by:
Dear all, if I do myform.close() is it disposed or not? is it correct do following? myForm.close() Info=SomeControlOntheForm.text This seems to work. But am not sure that it is waterproof....
4
by: Rich | last post by:
Hello, my app opens a 2nd form (form2) by clicking a button on the first form (form1). I do not want to open form2 in modal form, but I only want one instance of form2 open. So if someone...
6
by: ahmad.humyn | last post by:
I want to call a hidden form. My code goes something like in which the main calls form1. form1 has a button which creates & calls form2 and hides itself. Now I have a button in form2 which if...
1
by: teslar91 | last post by:
I've been learning VB.NET for the past few weeks. One of the problems I've run into is difficulties updating controls in events from certain components, such as the FileSystemWatcher, that raise...
5
by: aine_canby | last post by:
Hi, The problem is that the line - this.Invoke(new MyDelegate(Function), args); // this = MainForm is being called after the line - terminatePopulate = true; therefore I get an exception...
7
by: Dan Tallent | last post by:
I have an application I'm working on where one form will open another. This newly opened form needs to return a value based on the users actions. My forms are not modal. I have seen discussions...
2
by: BillE | last post by:
Using vb.net 2008 windows forms. How can a form which has been closed and disposed still attempt to handle a custom event? I have a form which inherits from a base form class. The base...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.