Form.ShowDialog() / ShowDialog(IWin32Window)

  • Thread starter Thread starter peshrad
  • Start date Start date
P

peshrad

Hi !

Is there anybody who knows (if possible, by theory and practice)
what sense it makes
to hand over an owner to Form.ShowDialog ?

I cannot close/minimize the owning window while the dialog is in the popped
up state.
Hence, I don't understand what practical difference it makes handing over an
owner or not.

Your kind help would be appreciated.
 
Hi,

The difference is that in the second case you tell the modal form who its
parent is. This, for example, enables the window manager to handle
activation correctly when you switch from and back to your application, and
allows for correct window hierarchy maintained by the system.
 
Hi,

This is a guess of a possible escenario where you could use it, what if a
child window of a MDI app show the dialog and it want that no other window
of the application can get focus?
if you use the ShowDialog () version I think that only the opener child is
invalidated, and if you want this dialog to be modal to the entire
application you should use the other version of ShowDialog.

Note,
I haven;t tested the above, it's just a logic explanation.

Cheers,
 
Back
Top