MessageBox.Show Metoda

Definicja

Wyświetla pole komunikatu.

Przeciążenia

Show(String)

Wyświetla pole komunikatu z komunikatem i zwraca wynik.

Show(String, String)

Wyświetla pole komunikatu z podpisem komunikatu i paska tytułu; i zwraca wynik.

Show(Window, String)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat i zostanie zwrócony wynik.

Show(String, String, MessageBoxButton)

Wyświetla pole komunikatu z napisem na pasku tytułu i przyciskiem; i zwraca wynik.

Show(Window, String, String)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony podpis komunikatu i paska tytułu; i zwraca wynik.

Show(String, String, MessageBoxButton, MessageBoxImage)

Wyświetla pole komunikatu z napisem na pasku tytułu, przyciskiem i ikoną; i zwraca wynik.

Show(Window, String, String, MessageBoxButton)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu i przycisk; a także zwraca wynik.

Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult)

Wyświetla pole komunikatu z napisem na pasku tytułu, przyciskiem i ikoną; i akceptuje domyślny wynik pola komunikatu i zwraca wynik.

Show(Window, String, String, MessageBoxButton, MessageBoxImage)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu, przycisk i ikona; a także zwraca wynik.

Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions)

Wyświetla pole komunikatu z napisem na pasku tytułu, przyciskiem i ikoną; i akceptuje domyślny wynik pola komunikatu, jest zgodny z określonymi opcjami i zwraca wynik.

Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu, przycisk i ikona; i akceptuje wynik pola komunikatu domyślnego i zwraca wynik.

Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu, przycisk i ikona; i akceptuje domyślny wynik pola komunikatu, jest zgodny z określonymi opcjami i zwraca wynik.

Uwagi

Użyj przeciążenia Show metody, która umożliwia określenie okna właściciela. W przeciwnym razie pole komunikatu jest własnością okna, które jest obecnie aktywne.

Show(String)

Wyświetla pole komunikatu z komunikatem i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::String ^ messageBoxText);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (string messageBoxText);
public static System.Windows.MessageBoxResult Show (string messageBoxText);
[<System.Security.SecurityCritical>]
static member Show : string -> System.Windows.MessageBoxResult
static member Show : string -> System.Windows.MessageBoxResult
Public Shared Function Show (messageBoxText As String) As MessageBoxResult

Parametry

messageBoxText
String

Element String określający tekst do wyświetlenia.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak używać tego przeciążenia Show metody.

private void ShowMessageBoxButton_Click(object sender, RoutedEventArgs e)
{
    // Configure message box
    string message = "Hello, MessageBox!";
    // Show message box
    MessageBoxResult result = MessageBox.Show(message);
}
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' Configure message box
    Dim message As String = "Hello, MessageBox!"
    ' Show message box
    Dim result As MessageBoxResult = MessageBox.Show(message)
End Sub

Dotyczy

Show(String, String)

Wyświetla pole komunikatu z podpisem komunikatu i paska tytułu; i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::String ^ messageBoxText, System::String ^ caption);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption);
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption);
[<System.Security.SecurityCritical>]
static member Show : string * string -> System.Windows.MessageBoxResult
static member Show : string * string -> System.Windows.MessageBoxResult
Public Shared Function Show (messageBoxText As String, caption As String) As MessageBoxResult

Parametry

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak używać tego przeciążenia Show metody.

private void ShowMessageBoxButton_Click(object sender, RoutedEventArgs e)
{
    // Configure message box
    string message = "Message text";
    string caption = "Caption text";
    // Show message box
    MessageBoxResult result = MessageBox.Show(message, caption);
}
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' Configure message box
    Dim message As String = "Message text"
    Dim caption As String = "Caption text"
    ' Show message box
    Dim result As MessageBoxResult = MessageBox.Show(message, caption)
End Sub

Dotyczy

Show(Window, String)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat i zostanie zwrócony wynik.

public:
 static System::Windows::MessageBoxResult Show(System::Windows::Window ^ owner, System::String ^ messageBoxText);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText);
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText);
[<System.Security.SecurityCritical>]
static member Show : System.Windows.Window * string -> System.Windows.MessageBoxResult
static member Show : System.Windows.Window * string -> System.Windows.MessageBoxResult
Public Shared Function Show (owner As Window, messageBoxText As String) As MessageBoxResult

Parametry

owner
Window

Element Window reprezentujący okno właściciela okna komunikatu.

messageBoxText
String

Element String określający tekst do wyświetlenia.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Uwagi

Domyślnie okno komunikatu jest wyświetlane przed oknem, które jest obecnie aktywne.

Zobacz też

Dotyczy

Show(String, String, MessageBoxButton)

Wyświetla pole komunikatu z napisem na pasku tytułu i przyciskiem; i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button);
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button);
[<System.Security.SecurityCritical>]
static member Show : string * string * System.Windows.MessageBoxButton -> System.Windows.MessageBoxResult
static member Show : string * string * System.Windows.MessageBoxButton -> System.Windows.MessageBoxResult
Public Shared Function Show (messageBoxText As String, caption As String, button As MessageBoxButton) As MessageBoxResult

Parametry

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak używać tego przeciążenia Show metody.

private void ShowMessageBoxButton_Click(object sender, RoutedEventArgs e)
{
    // Configure message box
    string message = "Hello, MessageBox!";
    string caption = "Caption text";
    MessageBoxButton buttons = MessageBoxButton.OKCancel;
    // Show message box
    MessageBoxResult result = MessageBox.Show(message, caption, buttons);
}
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' Configure message box
    Dim message As String = "Hello, MessageBox!"
    Dim caption As String = "Caption text"
    Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
    ' Show message box
    Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons)
End Sub

Dotyczy

Show(Window, String, String)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony podpis komunikatu i paska tytułu; i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::Windows::Window ^ owner, System::String ^ messageBoxText, System::String ^ caption);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption);
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption);
[<System.Security.SecurityCritical>]
static member Show : System.Windows.Window * string * string -> System.Windows.MessageBoxResult
static member Show : System.Windows.Window * string * string -> System.Windows.MessageBoxResult
Public Shared Function Show (owner As Window, messageBoxText As String, caption As String) As MessageBoxResult

Parametry

owner
Window

Element Window reprezentujący okno właściciela okna komunikatu.

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Uwagi

Domyślnie okno komunikatu jest wyświetlane przed oknem, które jest obecnie aktywne.

Zobacz też

Dotyczy

Show(String, String, MessageBoxButton, MessageBoxImage)

Wyświetla pole komunikatu z napisem na pasku tytułu, przyciskiem i ikoną; i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button, System::Windows::MessageBoxImage icon);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon);
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon);
[<System.Security.SecurityCritical>]
static member Show : string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage -> System.Windows.MessageBoxResult
static member Show : string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage -> System.Windows.MessageBoxResult
Public Shared Function Show (messageBoxText As String, caption As String, button As MessageBoxButton, icon As MessageBoxImage) As MessageBoxResult

Parametry

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

icon
MessageBoxImage

MessageBoxImage Wartość określająca ikonę do wyświetlenia.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak używać tego przeciążenia Show metody.

private void ShowMessageBoxButton_Click(object sender, RoutedEventArgs e)
{
    // Configure message box
    string message = "Hello, MessageBox!";
    string caption = "Caption text";
    MessageBoxButton buttons = MessageBoxButton.OKCancel;
    MessageBoxImage icon = MessageBoxImage.Information;
    // Show message box
    MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon);
}
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' Configure message box
    Dim message As String = "Hello, MessageBox!"
    Dim caption As String = "Caption text"
    Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
    Dim icon As MessageBoxImage = MessageBoxImage.Information
    ' Show message box
    Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons, icon)
End Sub

Dotyczy

Show(Window, String, String, MessageBoxButton)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu i przycisk; a także zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::Windows::Window ^ owner, System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button);
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button);
[<System.Security.SecurityCritical>]
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton -> System.Windows.MessageBoxResult
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton -> System.Windows.MessageBoxResult
Public Shared Function Show (owner As Window, messageBoxText As String, caption As String, button As MessageBoxButton) As MessageBoxResult

Parametry

owner
Window

Element Window reprezentujący okno właściciela okna komunikatu.

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Uwagi

Domyślnie okno komunikatu jest wyświetlane przed oknem, które jest obecnie aktywne.

Zobacz też

Dotyczy

Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult)

Wyświetla pole komunikatu z napisem na pasku tytułu, przyciskiem i ikoną; i akceptuje domyślny wynik pola komunikatu i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button, System::Windows::MessageBoxImage icon, System::Windows::MessageBoxResult defaultResult);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult);
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult);
[<System.Security.SecurityCritical>]
static member Show : string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult -> System.Windows.MessageBoxResult
static member Show : string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult -> System.Windows.MessageBoxResult
Public Shared Function Show (messageBoxText As String, caption As String, button As MessageBoxButton, icon As MessageBoxImage, defaultResult As MessageBoxResult) As MessageBoxResult

Parametry

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

icon
MessageBoxImage

MessageBoxImage Wartość określająca ikonę do wyświetlenia.

defaultResult
MessageBoxResult

MessageBoxResult Wartość określająca domyślny wynik pola komunikatu.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak używać tego przeciążenia Show metody.

private void ShowMessageBoxButton_Click(object sender, RoutedEventArgs e)
{
    // Configure message box
    string message = "Hello, MessageBox!";
    string caption = "Caption text";
    MessageBoxButton buttons = MessageBoxButton.OKCancel;
    MessageBoxImage icon = MessageBoxImage.Information;
    MessageBoxResult defaultResult = MessageBoxResult.OK;
    // Show message box
    MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult);
}
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' Configure message box
    Dim message As String = "Hello, MessageBox!"
    Dim caption As String = "Caption text"
    Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
    Dim icon As MessageBoxImage = MessageBoxImage.Information
    Dim defaultResult As MessageBoxResult = MessageBoxResult.OK
    ' Show message box
    Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons, icon, defaultResult)
End Sub

Dotyczy

Show(Window, String, String, MessageBoxButton, MessageBoxImage)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu, przycisk i ikona; a także zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::Windows::Window ^ owner, System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button, System::Windows::MessageBoxImage icon);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon);
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon);
[<System.Security.SecurityCritical>]
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage -> System.Windows.MessageBoxResult
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage -> System.Windows.MessageBoxResult
Public Shared Function Show (owner As Window, messageBoxText As String, caption As String, button As MessageBoxButton, icon As MessageBoxImage) As MessageBoxResult

Parametry

owner
Window

Element Window reprezentujący okno właściciela okna komunikatu.

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

icon
MessageBoxImage

MessageBoxImage Wartość określająca ikonę do wyświetlenia.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Uwagi

Domyślnie okno komunikatu jest wyświetlane przed oknem, które jest obecnie aktywne.

Zobacz też

Dotyczy

Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions)

Wyświetla pole komunikatu z napisem na pasku tytułu, przyciskiem i ikoną; i akceptuje domyślny wynik pola komunikatu, jest zgodny z określonymi opcjami i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button, System::Windows::MessageBoxImage icon, System::Windows::MessageBoxResult defaultResult, System::Windows::MessageBoxOptions options);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult, System.Windows.MessageBoxOptions options);
public static System.Windows.MessageBoxResult Show (string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult, System.Windows.MessageBoxOptions options);
[<System.Security.SecurityCritical>]
static member Show : string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult * System.Windows.MessageBoxOptions -> System.Windows.MessageBoxResult
static member Show : string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult * System.Windows.MessageBoxOptions -> System.Windows.MessageBoxResult
Public Shared Function Show (messageBoxText As String, caption As String, button As MessageBoxButton, icon As MessageBoxImage, defaultResult As MessageBoxResult, options As MessageBoxOptions) As MessageBoxResult

Parametry

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

icon
MessageBoxImage

MessageBoxImage Wartość określająca ikonę do wyświetlenia.

defaultResult
MessageBoxResult

MessageBoxResult Wartość określająca domyślny wynik pola komunikatu.

options
MessageBoxOptions

MessageBoxOptions Obiekt wartości określający opcje.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak używać tego przeciążenia Show metody.

private void ShowMessageBoxButton_Click(object sender, RoutedEventArgs e)
{
    // Configure message box
    string message = "Hello, MessageBox!";
    string caption = "Caption text";
    MessageBoxButton buttons = MessageBoxButton.OKCancel;
    MessageBoxImage icon = MessageBoxImage.Information;
    MessageBoxResult defaultResult = MessageBoxResult.OK;
    MessageBoxOptions options = MessageBoxOptions.RtlReading;
    // Show message box
    MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult, options);
}
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' Configure message box
    Dim message As String = "Hello, MessageBox!"
    Dim caption As String = "Caption text"
    Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
    Dim icon As MessageBoxImage = MessageBoxImage.Information
    Dim defaultResult As MessageBoxResult = MessageBoxResult.OK
    Dim options As MessageBoxOptions = MessageBoxOptions.RtlReading
    ' Show message box
    Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons, icon, defaultResult, options)
End Sub

Dotyczy

Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu, przycisk i ikona; i akceptuje wynik pola komunikatu domyślnego i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::Windows::Window ^ owner, System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button, System::Windows::MessageBoxImage icon, System::Windows::MessageBoxResult defaultResult);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult);
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult);
[<System.Security.SecurityCritical>]
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult -> System.Windows.MessageBoxResult
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult -> System.Windows.MessageBoxResult
Public Shared Function Show (owner As Window, messageBoxText As String, caption As String, button As MessageBoxButton, icon As MessageBoxImage, defaultResult As MessageBoxResult) As MessageBoxResult

Parametry

owner
Window

Element Window reprezentujący okno właściciela okna komunikatu.

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

icon
MessageBoxImage

MessageBoxImage Wartość określająca ikonę do wyświetlenia.

defaultResult
MessageBoxResult

MessageBoxResult Wartość określająca domyślny wynik pola komunikatu.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Uwagi

Domyślnie okno komunikatu jest wyświetlane przed oknem, które jest obecnie aktywne.

Zobacz też

Dotyczy

Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions)

Wyświetla pole komunikatu przed określonym oknem. W polu komunikatu zostanie wyświetlony komunikat, podpis paska tytułu, przycisk i ikona; i akceptuje domyślny wynik pola komunikatu, jest zgodny z określonymi opcjami i zwraca wynik.

public:
 static System::Windows::MessageBoxResult Show(System::Windows::Window ^ owner, System::String ^ messageBoxText, System::String ^ caption, System::Windows::MessageBoxButton button, System::Windows::MessageBoxImage icon, System::Windows::MessageBoxResult defaultResult, System::Windows::MessageBoxOptions options);
[System.Security.SecurityCritical]
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult, System.Windows.MessageBoxOptions options);
public static System.Windows.MessageBoxResult Show (System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, System.Windows.MessageBoxResult defaultResult, System.Windows.MessageBoxOptions options);
[<System.Security.SecurityCritical>]
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult * System.Windows.MessageBoxOptions -> System.Windows.MessageBoxResult
static member Show : System.Windows.Window * string * string * System.Windows.MessageBoxButton * System.Windows.MessageBoxImage * System.Windows.MessageBoxResult * System.Windows.MessageBoxOptions -> System.Windows.MessageBoxResult
Public Shared Function Show (owner As Window, messageBoxText As String, caption As String, button As MessageBoxButton, icon As MessageBoxImage, defaultResult As MessageBoxResult, options As MessageBoxOptions) As MessageBoxResult

Parametry

owner
Window

Element Window reprezentujący okno właściciela okna komunikatu.

messageBoxText
String

Element String określający tekst do wyświetlenia.

caption
String

Element String określający podpis paska tytułu do wyświetlenia.

button
MessageBoxButton

MessageBoxButton Wartość określająca, który przycisk lub przyciski mają być wyświetlane.

icon
MessageBoxImage

MessageBoxImage Wartość określająca ikonę do wyświetlenia.

defaultResult
MessageBoxResult

MessageBoxResult Wartość określająca domyślny wynik pola komunikatu.

options
MessageBoxOptions

MessageBoxOptions Obiekt wartości określający opcje.

Zwraca

MessageBoxResult

MessageBoxResult Wartość określająca, który przycisk pola komunikatu jest klikany przez użytkownika.

Atrybuty

Uwagi

Domyślnie okno komunikatu jest wyświetlane przed oknem, które jest obecnie aktywne.

Zobacz też

Dotyczy