Accessing IsInDesignMode attached property

Declan_Basile
Declan_Basile used Ask the Experts™
on
In VB.net, I'm trying to use the system.components.designerproperties.IsInDesignMode attached property to prevent code from running in design mode but designerproperties isn't showing up in intellisense when I type "system.components.".  I also tried to include "Import system.components" in my code and it still doesn't show up.  How can I access the "IsInDesignMode" property in my code?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
As long as you're using visual studio, you can check the current process name, via "System.Diagnostics.Process.GetCurrentProcess().ProcessName", and if it is  "devenv" then the code is being executed in design mode.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial