DesignMode in constructor 
Author Message
 DesignMode in constructor


I try to assign value to variable in contructor and call some methods, but
I'd like to do it at run-time. When I get DesignMode property in
constructor, it always return FALSE at design time. What should I do to
check when I am in design mode ?

public class ClassA : System.Windows.Forms.UserControl
    public ClassA
          var1 = new ClassB();
         if (!DesignMode)  // <--------- Always return FALSE
            var1.XValue = "Hello";



Mon, 16 May 2005 21:56:46 GMT  
 DesignMode in constructor

Do you have to do this in the constructor? Another option might be to
implement ISupportInitialize. By the time EndInit() is called, the
DesignMode property should be available.


Please reply only to the newsgroup.

Tue, 17 May 2005 05:08:26 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Implementing ISite to have access to DesignMode indicator

2. DesignMode problem

3. How To: Selected Item or Items in Web Browser (in designMode)

4. Is DesignMode property working???

5. designmode appearance & code

6. ATL DesignMode

7. Move the caret in designMode (ihtmldocument2)

8. constructor that calls a constructor

9. Invoking another constructor within a constructor

10. Calling Default Constructor from another constructor

11. Call other constructor in a constructor

12. Can you call a default constructor from an overloaded constructor


Powered by phpBB® Forum Software