Q:  How can my component tell if I'm in design mode or running?

A:  If the component is being used in the IDE the following test will evaluate as true:

  csDesigning in ComponentState