C
Chris Capel
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() {
InitializeComponent();
if (!System.ComponentModel.Design.MagicClass.IsDesignTime)
DoSomethingUnsafeAtDesignTime();
}
}
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() {
InitializeComponent();
if (!System.ComponentModel.Design.MagicClass.IsDesignTime)
DoSomethingUnsafeAtDesignTime();
}
}
Otherwise, I can't put my control on my form with the designer, which is
mighty annoyin'.
Chris