Search code examples
c#winformsdialogtopmostnon-modal

How do you make a non-modal topmost dialog that is only topmost in regards to the parent form in WinForms?


Thinking about this for an About dialog but I'm sure it's applicable in other places (say a find box)

Sorry if this is a dupe, but I couldn't find this or how to articulate the last part about it only being on top of the parent. How do you make a form that is always on top of the parent form, but is non-modal, but doesn't cover up other apps?


Solution

  • Try this to open your dialog:

    FindDialog fd = new FindDialog();
    fd.Show(this);
    

    The key is to assign dialog's owner.