Additional information: Cannot access a disposed object named

  • Thread starter Thread starter michael Schindler
  • Start date Start date
M

michael Schindler

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.ObjectDisposedException' occurred in
system.windows.forms.dll

Additional information: Cannot access a disposed object named
"DataGridTextBox".

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

has anywhere a idea?

private void dataGridFiBuMandantDetail_Click(object sender,
System.Windows.Forms.MouseEventArgs e)

{

// Bei Klick soll eine Detailmaske aufgehen

// Abfragen ob der Event gestartet werden darf

if (strEventMouseDown == "ON")

{

//string str = null;

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

DataGrid.HitTestInfo hti = dataGridFiBuMandant.HitTest(pt);

// Rechte Maustaste

if(e.Button == MouseButtons.Right)

{

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.Left) && (hti.Type ==
DataGrid.HitTestType.Cell))

{

frmHauptmenue.StrMandant = (dataGridFiBuMandant[hti.Row, 1].ToString());

frmHauptmenue.IntMandantID = (int)(dataGridFiBuMandant[hti.Row, 0]);

this.Close();

}

}

}
 
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.
 
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 dataGridFiBuMandantDetail_Click(object sender,
System.Windows.Forms.MouseEventArgs e)
{
this.Close();
}

if you have a solution..please help me..

thanks

michael
 
Back
Top