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
the case.
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
System.Diagnostics.Process.GetCurrentProcess().ProcessName
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.