Check the Form.DesignMode property. But note that when in Visual Inheritance mode (designing a derived form), your control's DesignMode property will be true when the base form's constructor gets executed in the design-time.
To workaround this, you could check if the application in which your control is running is not devenv.exe, as follows:
if ( Application.ExecutablePath.ToLower().IndexOf( "devenv.exe" ) > -1 )
{
// Then executing in Visual Studio .NET
}
Contributed from George Shepherd's Windows Forms FAQ