Догађаји
Изградите интелигентне апликације
17. мар 21 - 21. мар 10
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмахОвај прегледач више није подржан.
Надоградите на Microsoft Edge бисте искористили најновије функције, безбедносне исправке и техничку подршку.
You can create your own windows and display them in Windows Presentation Foundation (WPF). In this article, you'll learn how to display modal and modeless windows and dialogs.
Conceptually, a window and a dialog box are the same thing: they're displayed to a user to provide information or interaction. They're both "window" objects. The design of the window and the way it's used, is what makes a dialog box. A dialog box is generally small in size and requires the user to respond to it. For more information, see Overview of WPF windows and Dialog boxes overview.
If you're interested in opening operating system dialog boxes, see How to open a common dialog box.
When a modal window is opened, it generally represents a dialog box. WPF restricts interaction to the modal window, and the code that opened the window pauses until the window closes. This mechanism provides an easy way for you to prompt the user with data and wait for their response.
Use the ShowDialog method to open a window. The following code instantiates the window, and opens it modally. The code opening the window pauses, waiting for the window to be closed:
var window = new Margins();
window.Owner = this;
window.ShowDialog();
Dim myWindow As New Margins()
myWindow.Owner = Me
myWindow.ShowDialog()
Важно
Once a window is closed, the same object instance can't be used to reopen the window.
For more information about how to handle the user response to a dialog box, see Dialog boxes overview: Processing the response.
Opening a window modeless means displaying it as a normal window. The code that opens the window continues to run as the window becomes visible. You can focus and interact with all modeless windows displayed by your application, without restriction.
Use the Show method to open a window. The following code instantiates the window, and opens it modeless. The code opening the window continues to run:
var window = new Margins();
window.Owner = this;
window.Show();
Dim myWindow As New Margins()
myWindow.Owner = Me
myWindow.Show()
Важно
Once a window is closed, the same object instance can't be used to reopen the window.
.NET Desktop feedback повратне информације
.NET Desktop feedback је пројекат отвореног кода. Изаберите везу да бисте обезбедили повратне информације:
Догађаји
Изградите интелигентне апликације
17. мар 21 - 21. мар 10
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмах