Answer to Question #63267 in C# for Peter
What is the difference between .Show(); & .ShowDialog();
1
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!
Learn more about our help with Assignments:
C#
Comments
Leave a comment