What is the difference between ShowDialog () and ShowDialog (IWin32Window) in C #?

Both ShowDialog();and ShowDialog(IWin32Window);seem to be doing the same for me. The documentation is also not very clear.

I was told that it ShowDialog(IWin32Window);ensures that the dialog box is on top of everything that is passed as the owner window.

The MSDN documentation does not mention this, so it feels like black magic.

+5
source share
5 answers

ShowDialog(), . , (ShowDialog (IWin32Window)).

MSDN.

http://msdn.microsoft.com/en-us/library/c7ykbedk.aspx

+5

ShowDialog() ShowDialog(IWin32Window) . null, . null, GetActiveWindow(), IntPtr . , ILSpy.

+2

.NET "" . . " " Microsoft Word. , . , , .

(c) "Pro.NET 2.0 Windows Forms " .


ShowDialog , , , . , .

, ( ShowDialog):

  • , .
  • .
  • , .
  • .
  • , Alt + Tab , .

ShowDialog, , . , .

, , . , , .

ShowDialog , , . , . , Show, IWin32Window (IWin32Window Windows Forms, Win32 HWND IWin32Window.Handle).

, , . -, , . , , ​​ , . -, Alt + Tab , . , , , .

(c) "Windows Forms 2.0 Programming" by Chris Sales, Michael Weinhardt.

+1
source

frm2.ShowDialog () to make frm2 as a model dialog box, we cannot click anywhere on form1 unless we close the instance of frm2.

frm2.show () there is no such restriction.

0
source

All Articles