I have a user control that I'm building. It's purpose is to display the status of a class to the user. Obviously, this does not matter, and will slow things down when the control runs in the IDE, as it does as soon as you add it to a form.

One way to work around this would be to have the control created and added to the controls collection of the form at run-time. But this seems less than perfect.

Is there a way to set a flag in the control so that it can skip certain sections of code based on how it is running?

p.s. I'm using C# and VS 2008