Hi,
[C# / VS2003]
I've run into a weird problem with the form designer. I have three classes:
a messagebox class and two forms (Base and Derived which is derived from
Base):
(note: only relevant code below)
<code>
public class MyMsg
{
[DllImport("user32.dll", EntryPoint="MessageBoxW",
CharSet=CharSet.Unicode, ExactSpelling=true,
CallingConvention=CallingConvention.StdCall)]
private static extern IntPtr MessageBox(UInt32 hWnd, string AText,
string ACaption, UInt32 AType);
public static void Show(string AText)
{
MessageBox(0, AText, "Caption", 0);
}
}
public class BaseForm : System.Windows.Forms.Form
{
public BaseForm()
{
InitializeComponent();
MyMsg.Show("Test");
}
}
public class DerivedForm : BaseForm
{
public DerivedForm()
{
InitializeComponent();
}
}
</code>
When I show DerivedForm in the designer my messagebox is shown. When I show
BaseForm in the designer, the messagebox is NOT shown. What gives?! Is this
a bug?
Are there any specifications of what and what isn't created/shown/whatever
designtime vs. runtime?
I know the above code doesn't really make sense, but its a simplification of
some similar code used for singleton patterns...
Regards,
Sebastian