Answer to Question #63267 in C# for Peter

Question #63267
What is the difference between .Show(); & .ShowDialog();
1
Expert's answer
2016-11-19T06:05:10-0500
Both methods are used to display other windows by creating instance of other window in .net windows (also in WPF) application development.

The common differences are:

.Show()

Using this method, the user can switch between windows in the application.

Each opened window process requests separately.

Used when, an application execution proceeds normally.

Syntax to display: SubWindow subWin = new SubWindow(); subWin.Show();

Syntax to close :subWin.Close();



.ShowDialog()

Using this method, the new window is the only window display over the other windows in the application.

Only opened window responds to user input until it is closed.

Used when, to create custom dialog boxes or in other situation that requires user input require before an application can proceed.

Syntax to display: SubWindow subWin = new SubWindow(); subWin.ShowDialog();

Syntax to close :subWin.Close();

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS