Cannot access a disposed object

  • Thread starter Thread starter salih ataoz
  • Start date Start date
S

salih ataoz

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
 
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 said:
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
 
Back
Top