Active Form

All I would like to know is how to keep my form active all the time.


Answer this question

Active Form

  • young.k.joo

    You Activate the form on inactivation, for example:


    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);


  • Active Form