How to show ShowDialog () from MDIChild form correctly?

I have an MDIChild form that should show a dialog. I am currently doing this so from within the mdichild form ...

f.ShowDialog(Me)

Should i use f.ShowDialog(mdiparent)?

What is the difference when setting up an owner before a call ShowDialog()?

+3
source share
3 answers

The difference is in which parent the dialogue belongs. If you explicitly specify the parent, then this window has a dialog. If you do not install it (using the parameterless version of ShowDialog), then the current active window of your application will have a dialog box. This is on MSDN , by the way.

, StartPosition FormStartPosition.CenterParent.

+3

, , Owning ShowDialog, :

f.Owner = Me
f.ShowDialog()
+4

...

MDI, ShowDialog (Me), Me.Owner MDI, MDI .

Me.Owner.ActiveControl , :

       Dim ContractForm As New Contract(strType, intMode)
       ContractForm.Owner = Me
       dgrAction = ContractForm.ShowDialog()

. Me.Owner MDI.

, !

0

Source: https://habr.com/ru/post/1702383/


All Articles