I came across interesting issue with one of our controls. I needed a
different behavior during design-time and run-time. I was sure that
.NET Framework has a nice solution for me, but I found out this is not
There is a DesignMode property but according to several sources it doesn't always work as expected. There seems to be more that one way to solve the issue. I decided to use
and check if it equals string "devenv".
If it does, the instance is running inside Visual Studio, which means
it's design-time for our control. For my problem this simple solution
worked as a charm.