Creating a UserControl for a program, i ran into the problem of detecting whether i was running code in design mode or not. The problem with the DesignMode property from the Component class is that it doesn't work properly in the constructor. I created an overload of the property:
1: public new bool DesignMode { 2: get { 3: return (Process.GetCurrentProcess().ProcessName.Equals("devenv", 4: StringComparison.OrdinalIgnoreCase));
5: }
6: }