How to correctly ShowDialog() from inside an MDIChild form?

dotjoe picture dotjoe · Jan 28, 2009 · Viewed 9.1k times · Source

I have an MDIChild form that needs to show a dialog. I'm currently doing it like this from inside the mdichild form...

f.ShowDialog(Me)

Should I be using f.ShowDialog(mdiparent)?

What is the difference when setting the owner before calling ShowDialog()?

Answer

Joey picture Joey · Jan 28, 2009

I'm not sure if this is related, but I've had some issues with passing the owning form in ShowDialog, I usually do this:

f.Owner = Me
f.ShowDialog()