Is there any boolean flag set during design time that a UserControl can test
to see whether to run code that only works during runtime (because of
complicated initialization) ?
Like this:
public class MyControl : UserControl {
public MyControl() {
InitializeCompo nent();
if (!System.Compon entModel.Design .MagicClass.IsD esignTime)
DoSomethingUnsa feAtDesignTime( );
}
}
Otherwise, I can't put my control on my form with the designer, which is
mighty annoyin'.
Chris
to see whether to run code that only works during runtime (because of
complicated initialization) ?
Like this:
public class MyControl : UserControl {
public MyControl() {
InitializeCompo nent();
if (!System.Compon entModel.Design .MagicClass.IsD esignTime)
DoSomethingUnsa feAtDesignTime( );
}
}
Otherwise, I can't put my control on my form with the designer, which is
mighty annoyin'.
Chris
Comment