473,503 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error calling a form that has been Closed with this.Close();

110 New Member
I have a program that uses a custom message box. There is only the OK button on it which I originally coded with:
Expand|Select|Wrap|Line Numbers
  1. this.close();
  2.  
but then if I ever tried to load the message box again it said "can not access disposed form".

I then set it instead to just hide the form when the ok button was clicked, which works, but I am not sure if it is running unnecessary resources?

Can anyone make a suggestion on whether I'll be ok having the form hidden (the form contains one small graphic and 3 labels if that makes a difference) or is there a way to close that form but still be able to call it again from the parent form?

Thanks.
Dec 26 '10 #1
2 1701
Plater
7,872 Recognized Expert Expert
If you close() a form, its done. You would have to start all over.
Hide()'ing the form is a better method if it gets used regularly. If the form is hardly ever used, it MIGHT be better to close/dispose/start over with a new one when you need it.
Dec 27 '10 #2
Fuzz13
110 New Member
"If you close() a form, its done."
I think that says it most perfectly. I went ahead and used the hide method. Thank you for explaining that for me.
Dec 28 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
10866
by: Sherwood | last post by:
Greetings, I have the following code (which displays a second form), but it is not working as expected. I want to close the calling form after the dismissing the second form. However, the...
4
2850
by: kathy | last post by:
Working in a form, I have an Iif statement where if a date is not filled in, another field will show as a blank. If the date IS filled in, the 2nd field will show its actual value. The following...
10
600
by: headware | last post by:
I know that you can call the method of one from from inside another form by doing something like this Forms("MyForm").MyFunction(12, 34) However, you have to know that MyForm has a function...
6
3214
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
5
1820
by: Wittaya | last post by:
I am using command Me.Closed()in Event of TreeView AfterSelect. This below is Error Message appear. An unhandled exception of type 'System Object Disposed Exception' occured in...
10
1609
by: Norm | last post by:
I must not be understanding something about the use of forms in VB.Net that is different from VB. I have one form running in the background with an icon in the task bar. Right clicking on the icon...
5
2703
by: Eric Renken | last post by:
OK, I have a form with a menu and a tool bar. In the Menu I have a File menu that contains a "Exit" item. When I click this Exit item. I have an event wired to: mnuFile.DropDown.ItemClicked ...
1
3850
by: dan.c.roth | last post by:
oForm.Close() vs this.Close() in a modal dialog. oFrom.Close() calls Form.Dispose() but this.Close() ,say in the click event of the Form, does not. I can think of the reason for this but is...
1
3173
by: sphinney | last post by:
All, I'm not sure how to adequately explain my problem in two sentences or less, so at the risk of providing TMI, here's the condensed verion. I have developed an Access 2002 database file that...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.