Getting an error after using ActiveForm in debug mode!!!
Hello,
After using method activeform to get the active form in my app, i try to clear all controls from the form so i can add new controls to it, just like this:
Form currentForm = Form1.ActiveForm;
currentForm.Controls.Clear();
When i run in debug mode, i get an exception for Object reference not set to an instance of an object. But if i run it without debbuging it works ok.
Does anybody know why this happens?
Thank you.
e.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ytram5107 reputationPosted Mar 17, 2005, 10:36 AM EST
edua_113688 reputationPosted Mar 17, 2005, 12:28 PM EST