Software Development Network>> Visual C#>> Active Form
If you are launching this form from another say-
this.Owner = parentForm;
This makes it stay on top of the parent always.
If you want to use a modal form,
say form.ShowDialog(this);
Active Form
young.k.joo
private const int WM_ACTIVATE = 6;
private const int WA_INACTIVE = 0;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if(m.Msg == WM_ACTIVATE)
{
if(((int)m.WParam & 0xFFFF) == WA_INACTIVE)
{
this.Activate();
}
}
}
Nico V
If you are launching this form from another say-
this.Owner = parentForm;
This makes it stay on top of the parent always.
If you want to use a modal form,
say form.ShowDialog(this);