473,395 Members | 1,706 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,395 software developers and data experts.

Cannot access a disposed object

i close a form and i want to open it again it show me

Cannot access a disposed object

at vb6 this is ok
at comman1_click
form1.show

at comman2_click
form1.close

i click one then other again again and again
at vb6 its ok but at vb.net
i take this msg
Cannot access a disposed object

how i can close the forms and open it again and again
Jul 21 '05 #1
2 5455
Without seeing any more of that code... your probably creating a NEW
instance of the object somewhere else.... and just not showing it until
you get to that point in time.....

close.... means you want to dispense with the object.... if you mean to
HIDE the object... then do that...

HTH

"salih ataoz" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
i close a form and i want to open it again it show me

Cannot access a disposed object

at vb6 this is ok
at comman1_click
form1.show

at comman2_click
form1.close

i click one then other again again and again
at vb6 its ok but at vb.net
i take this msg
Cannot access a disposed object

how i can close the forms and open it again and again

Jul 21 '05 #2

"salih ataoz" <an*******@discussions.microsoft.com> schreef in bericht
news:00****************************@phx.gbl...
i close a form and i want to open it again it show me

Cannot access a disposed object

at vb6 this is ok
at comman1_click
form1.show

at comman2_click
form1.close

i click one then other again again and again
at vb6 its ok but at vb.net
i take this msg
Cannot access a disposed object

how i can close the forms and open it again and again


Do you want the same form each time? Then you should look at hide instead
of close. If you use close you'll need to create a new instance of the form
each time.

Yves

Jul 21 '05 #3

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

Similar topics

7
by: Ryan Park | last post by:
Hi, //SITUATION I got a panel control that hold a certain position on a form. Every controls or UIs are on this panel. At certain situation, I called dispose() method of this panel control...
5
by: D Witherspoon | last post by:
I use the following code to open up a form. ------------------------------------------------------- If fImage Is Nothing Then fImage = New frmImage End If fImage.Show()
5
by: theinvisibleGhost | last post by:
I'm having a problem that occurs at random in my app. I get an exception "Cannot Access a disposed object" In MSCorLib when calling boolean Change (int32, int32) Stack trace reveals...
5
by: mthgk | last post by:
I have a C# MDI app. The child forms do alot of work, so this work is perfomed on a different thread created using ThreadPool.QueueUserWorkItem(). Because the status of the work is important to...
3
by: Tracey | last post by:
sorry I post this problem again. I have to stop my work to fix the problem. I'm doing a multi form application(Not a MDI one). My startup form say Form1 has a datagrid say datagrid1, when I...
2
by: salih ataoz | last post by:
i close a form and i want to open it again it show me Cannot access a disposed object at vb6 this is ok at comman1_click form1.show
2
by: Rajat Tandon | last post by:
Hi, I have a grid which is continuously updating by the data from a external event. When I close the form on which the grid is placed, then it gives the error message ... "Can not access a...
1
by: Amit Dedhia | last post by:
Hi I am having problem working with Timers in C++/CLI (the .NET version of C++) I have an application which has several forms with pictureBox controls on it. There is a background timer...
4
JustRun
by: JustRun | last post by:
Hi All, I'm developing a windows desktop solution using VC# , I deal with my database using Dataset. My Problem that i'm trying to call a Form to display a confirmation message after every...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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
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...

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.