473,799 Members | 3,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Additional information: Cannot access a disposed object named

I get an error message since i installed visual studio 2003 :-(

Please help me why i get this message?

An unhandled exception of type 'System.ObjectD isposedExceptio n' occurred in
system.windows. forms.dll

Additional information: Cannot access a disposed object named
"DataGridTextBo x".

I get this after this syntax... i have no idea why i get this..

has anywhere a idea?

private void dataGridFiBuMan dantDetail_Clic k(object sender,
System.Windows. Forms.MouseEven tArgs e)

{

// Bei Klick soll eine Detailmaske aufgehen

// Abfragen ob der Event gestartet werden darf

if (strEventMouseD own == "ON")

{

//string str = null;

Point pt = new Point(e.X, e.Y);

DataGrid.HitTes tInfo hti = dataGridFiBuMan dant.HitTest(pt );

// Rechte Maustaste

if(e.Button == MouseButtons.Ri ght)

{

MessageBox.Show ("Bitte mit der linken Maustaste anklicken, \n" +

"um das Detail dieser Zeile anzuzeigen. \n"+

"Das Löschen mit der Maus erfolgt später.");

}

// Linke Maustaste

if ((e.Button == MouseButtons.Le ft) && (hti.Type ==
DataGrid.HitTes tType.Cell))

{

frmHauptmenue.S trMandant = (dataGridFiBuMa ndant[hti.Row, 1].ToString());

frmHauptmenue.I ntMandantID = (int)(dataGridF iBuMandant[hti.Row, 0]);

this.Close();

}

}

}


Nov 15 '05 #1
2 4316

Hi,

There's too less code for figuring out what's happening. It's a runtime
error, so what's the line where this error occures? What was the previous
actions you did before the error occured?

Most probably the "Dispose" method of the form is started (this.Close()
?????), and that disposes all your controls on the form, and after that you
are trying to call some method that refers some contol.

--
Horatiu Ripa

"michael Schindler" <mr******@hotma il.com> wrote in message
news:uL******** ******@TK2MSFTN GP11.phx.gbl...
I get an error message since i installed visual studio 2003 :-(

Please help me why i get this message?

An unhandled exception of type 'System.ObjectD isposedExceptio n' occurred in system.windows. forms.dll

Additional information: Cannot access a disposed object named
"DataGridTextBo x".

I get this after this syntax... i have no idea why i get this..

has anywhere a idea?

private void dataGridFiBuMan dantDetail_Clic k(object sender,
System.Windows. Forms.MouseEven tArgs e)

{

// Bei Klick soll eine Detailmaske aufgehen

// Abfragen ob der Event gestartet werden darf

if (strEventMouseD own == "ON")

{

//string str = null;

Point pt = new Point(e.X, e.Y);

DataGrid.HitTes tInfo hti = dataGridFiBuMan dant.HitTest(pt );

// Rechte Maustaste

if(e.Button == MouseButtons.Ri ght)

{

MessageBox.Show ("Bitte mit der linken Maustaste anklicken, \n" +

"um das Detail dieser Zeile anzuzeigen. \n"+

"Das Löschen mit der Maus erfolgt später.");

}

// Linke Maustaste

if ((e.Button == MouseButtons.Le ft) && (hti.Type ==
DataGrid.HitTes tType.Cell))

{

frmHauptmenue.S trMandant = (dataGridFiBuMa ndant[hti.Row, 1].ToString());

frmHauptmenue.I ntMandantID = (int)(dataGridF iBuMandant[hti.Row, 0]);

this.Close();

}

}

}


Nov 15 '05 #2
The problem is that:

I think the new framework version is my problem...
New i have 1.1 with vs 2003

And i think the event mousedown is the problem.

My code in short version..whit the same error:

private void dataGridFiBuMan dantDetail_Clic k(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
this.Close();
}

if you have a solution..pleas e help me..

thanks

michael
Nov 15 '05 #3

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

Similar topics

7
22747
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 and change it with other panel which contains other business logic and UI controls.
5
6134
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()
0
339
by: Asaf | last post by:
Hi, When I am doing a POST to a SSL URL I am getting this error on first attempt "Cannot access a disposed object named "System.Net.TlsStream"." After the first attempt all works fine, here is the Stack Trace at System.Net.TlsStream.InnerWrite(Boolean async, Byte buffer, Int32 offset, Int32 size, AsyncCallback asyncCallback, Object asyncState) at System.Net.TlsStream.BeginWrite(Byte buffer, Int32 offset, Int32 size, AsyncCallback...
0
1693
by: Mackuack | last post by:
Hello everybody i have the following code to access an application via https: --------------------------------------------- System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy(); httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
2
351
by: SMike | last post by:
I post this message again as I didn't get an answer back. I would appriciate any ideas. I am getting the following error when sending a first https request: Cannot access a disposed object named "System.Net.TlsStream". After that everything sems to be fine untill the next long idle period. The code is below.
5
6114
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 the user, I post the results in a richTextBox on the child form. I have created an event to do this since it is best to update the controls using the thread that they were created with (or so I've read). Anyway, the first time the user selects a...
3
1680
by: Tracey | last post by:
Hi, there I met a very wierd problem. My startup form say Form1 has a datagrid say datagrid1, when I click an item in datagrid1, I wanna show form2. In my code, I achieved that with: private sub Datagrid1_currentCellChanged(ByVal sender As Object, ByVal e As EventArgs) .... Me.close() dim frm2 as new form2()
7
2791
by: ed | last post by:
Hi, Here's my code 'in form WithEvents formReplace As New Form Private Sub cmdFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFind.Clic formReplace.Show(
3
1910
by: Ravindra Tripathi | last post by:
Hi I have a form with a textbox and a close button. whenever I try to close the the form i get an exception "cannot access disposed object named" how do i correct this issue? Ravindra
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4141
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 we have to send another system
3
2938
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.