rss
twitter
  •  

Show() & ShowDialog() @.Net

| Posted in C# |

0

when you create new form windows you want to show it so you use Show() or ShowDialog(), so what is the difference? ShowDialog is the same as Show, it just shows the form as a modal window. Modal meaning the form cannot lose focus until it is closed. (The user can’t click on other windows within the same application.)

in other meaning, ShowDialog the form is shown in a modal window. A modal form generally is used to show a dialog that must be closed until it takes back to the caller…for instance, the messagebox.show shows the message as a dialog, so the user should close it before the code continues to the next line. In the other hand, the show method just shows the form and continues executing the next line of the caller, when you open a form from a menu you usually shows it as no modal.

Post a comment