"cannot access disposed object named"

  • Thread starter Thread starter Ravindra Tripathi
  • Start date Start date
R

Ravindra Tripathi

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
 
Ravindra,

Do you have beside that textbox and button as well code written by you in
your program?

Cor
 
Yeah there is some code for the close button clicked event.

Apart from that I am parsing a XML, and using the values obtained from XML
to populate the textbox.

Private Sub cmdClose_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles cmdCancel.Click


Me.Hide()

Me.Close() 'This is the point where the codes stops and gives the exception
"cannot access disposed object named TextBox"


End Sub
 
Ravindra,

Although this is in my opinion not the error

Why do you hide your form for closing, do you think the user can see that
nanosecond, it will make the closing time in fact longer?

I am curious if you have more of this kind not necessary code in your
program.

Cor
 
Back
Top