System.ObjectDisposedException: 'Cannot access a disposed object.
How to fix this error.
Form2 frm2Obj;
private void button1_Click(object sender, EventArgs e)
{
if (frm2Obj is null)
{
frm2Obj = new Form2();
frm2Obj.Show();
}
else
frm2Obj.Show();
}
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rajanikant HawaldarRank #110 · 20.2K reputationPosted Nov 25, 2020, 2:54 AM EST
Patel73 reputationPosted Nov 25, 2020, 2:59 AM EST