Form over Form

How would I code the Program.cs or Form1.cs (whichever one) file so that Form 2 would appear above Form 1 as the program loads. For instance in Photoshop, the tools form appears above the main form as it loads, that's what I mean't.


Answer this question

Form over Form

  • Wayne_Peterson

    Hi,

    If you want to show the Form as Model Dialogue

    you can use

    Form.ShowDialogue()

    or else if you want show it as independent Form then use

    FormTool frm1 = new FormTool();

    frm1.Owner = this;

    frm1.Show();

    -thanks



  • swells

    You can set the Owner property of form2 to be form1, then form2 will never go under form1, but it wouldn't be topmost, you can open other apps and they will go above it.

    I think it's Owner, there's also a Parent property, it's either one or the other.



  • JonS1

    you can set the TopMost property of the form to True

    frm.TopMost = true; // to appear at the top of the other form in your program

    Happy programming


  • Form over Form