locked
How to detect DesignMode/Runtime mode with an Interop UserControl dropped on a VB6 form ?

    Question

  • I have a .NET UserControl created with the Interop forms toolkit and used on a VB6 form.  In my UserControl derived class, I do the following

    if(!this.DesignMode)
    {
        DoSomething();
    }

    When the control is used i Visual Studio 2005, this code works fine and DoSomething() is not executed.  However, when used in VB6, the DoSomething function is called even at design time

    Can someone give me some pointers on how to properly detect design time/runtime mode when the user control is used in VB6 ?

    Friday, March 19, 2010 3:47 PM

Answers