Answer to Question #63267 in C# for Peter

Question #63267
What is the difference between .Show(); & .ShowDialog();
Expert's answer
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:


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();


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!


No comments. Be the first!

Leave a comment

New on Blog