MessageBox.Show Metoda

Definice

Zobrazí okno se zprávou.

Přetížení

Show(String)

Zobrazí okno se zprávou obsahující zprávu a vrátí výsledek.

Show(String, String)

Zobrazí okno se zprávou, které má titulek zprávy a záhlaví; a vrátí výsledek.

Show(Window, String)

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva a vrátí výsledek.

Show(String, String, MessageBoxButton)

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví a tlačítko; a vrátí výsledek.

Show(Window, String, String)

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí titulek záhlaví a zprávy; a vrátí výsledek.

Show(String, String, MessageBoxButton, MessageBoxImage)

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví, tlačítko a ikonu; a vrátí výsledek.

Show(Window, String, String, MessageBoxButton)

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví a tlačítko; a vrátí také výsledek.

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

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví, tlačítko a ikonu; a přijme výchozí výsledek pole se zprávou a vrátí výsledek.

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

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví, tlačítko a ikona; a vrátí také výsledek.

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

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví, tlačítko a ikonu; a který přijímá výchozí výsledek pole se zprávou, vyhovuje zadaným možnostem a vrátí výsledek.

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

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví, tlačítko a ikona; a přijme výchozí výsledek pole se zprávou a vrátí výsledek.

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

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví, tlačítko a ikona; a přijme výchozí výsledek pole se zprávou, vyhovuje zadaným možnostem a vrátí výsledek.

Poznámky

Použijte přetížení Show metody, která umožňuje zadat okno vlastníka. V opačném případě je okno zprávy vlastněno oknem, které je aktuálně aktivní.

Show(String)

Zobrazí okno se zprávou obsahující zprávu a vrátí výsledek.

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

A String , který určuje text, který se má zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Příklady

Následující příklad ukazuje, jak tuto přetížení Show metody použít.

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

Platí pro

Show(String, String)

Zobrazí okno se zprávou, které má titulek zprávy a záhlaví; a vrátí výsledek.

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

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Příklady

Následující příklad ukazuje, jak tuto přetížení Show metody použít.

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

Platí pro

Show(Window, String)

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva a vrátí výsledek.

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

A Window , který představuje okno vlastníka okna zprávy.

messageBoxText
String

A String , který určuje text, který se má zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Poznámky

Ve výchozím nastavení se okno zprávy zobrazí před oknem, které je aktuálně aktivní.

Viz také

Platí pro

Show(String, String, MessageBoxButton)

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví a tlačítko; a vrátí výsledek.

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

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Příklady

Následující příklad ukazuje, jak tuto přetížení Show metody použít.

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

Platí pro

Show(Window, String, String)

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí titulek záhlaví a zprávy; a vrátí výsledek.

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

A Window , který představuje okno vlastníka okna zprávy.

messageBoxText
String

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Poznámky

Ve výchozím nastavení se okno zprávy zobrazí před oknem, které je aktuálně aktivní.

Viz také

Platí pro

Show(String, String, MessageBoxButton, MessageBoxImage)

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví, tlačítko a ikonu; a vrátí výsledek.

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

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

icon
MessageBoxImage

Hodnota MessageBoxImage , která určuje ikonu, která se má zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Příklady

Následující příklad ukazuje, jak tuto přetížení Show metody použít.

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

Platí pro

Show(Window, String, String, MessageBoxButton)

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví a tlačítko; a vrátí také výsledek.

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

A Window , který představuje okno vlastníka okna zprávy.

messageBoxText
String

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Poznámky

Ve výchozím nastavení se okno zprávy zobrazí před oknem, které je aktuálně aktivní.

Viz také

Platí pro

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

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví, tlačítko a ikonu; a přijme výchozí výsledek pole se zprávou a vrátí výsledek.

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

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

icon
MessageBoxImage

Hodnota MessageBoxImage , která určuje ikonu, která se má zobrazit.

defaultResult
MessageBoxResult

Hodnota MessageBoxResult , která určuje výchozí výsledek pole zprávy.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Příklady

Následující příklad ukazuje, jak tuto přetížení Show metody použít.

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

Platí pro

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

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví, tlačítko a ikona; a vrátí také výsledek.

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

A Window , který představuje okno vlastníka okna zprávy.

messageBoxText
String

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

icon
MessageBoxImage

Hodnota MessageBoxImage , která určuje ikonu, která se má zobrazit.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Poznámky

Ve výchozím nastavení se okno zprávy zobrazí před oknem, které je aktuálně aktivní.

Viz také

Platí pro

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

Zobrazí okno se zprávou, která obsahuje zprávu, titulek záhlaví, tlačítko a ikonu; a který přijímá výchozí výsledek pole se zprávou, vyhovuje zadaným možnostem a vrátí výsledek.

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

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

icon
MessageBoxImage

Hodnota MessageBoxImage , která určuje ikonu, která se má zobrazit.

defaultResult
MessageBoxResult

Hodnota MessageBoxResult , která určuje výchozí výsledek pole zprávy.

options
MessageBoxOptions

Objekt MessageBoxOptions hodnoty, který určuje možnosti.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Příklady

Následující příklad ukazuje, jak tuto přetížení Show metody použít.

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

Platí pro

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

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví, tlačítko a ikona; a přijme výchozí výsledek pole se zprávou a vrátí výsledek.

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

A Window , který představuje okno vlastníka okna zprávy.

messageBoxText
String

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

icon
MessageBoxImage

Hodnota MessageBoxImage , která určuje ikonu, která se má zobrazit.

defaultResult
MessageBoxResult

Hodnota MessageBoxResult , která určuje výchozí výsledek pole zprávy.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Poznámky

Ve výchozím nastavení se okno zprávy zobrazí před oknem, které je aktuálně aktivní.

Viz také

Platí pro

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

Zobrazí okno se zprávou před zadaným oknem. V okně zprávy se zobrazí zpráva, titulek záhlaví, tlačítko a ikona; a přijme výchozí výsledek pole se zprávou, vyhovuje zadaným možnostem a vrátí výsledek.

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

A Window , který představuje okno vlastníka okna zprávy.

messageBoxText
String

A String , který určuje text, který se má zobrazit.

caption
String

A String , který určuje titulek záhlaví, který se má zobrazit.

button
MessageBoxButton

Hodnota MessageBoxButton , která určuje, které tlačítko nebo tlačítka se mají zobrazit.

icon
MessageBoxImage

Hodnota MessageBoxImage , která určuje ikonu, která se má zobrazit.

defaultResult
MessageBoxResult

Hodnota MessageBoxResult , která určuje výchozí výsledek pole zprávy.

options
MessageBoxOptions

Objekt MessageBoxOptions hodnoty, který určuje možnosti.

Návraty

MessageBoxResult

Hodnota MessageBoxResult , která určuje, na které tlačítko pole zprávy uživatel klikne.

Atributy

Poznámky

Ve výchozím nastavení se okno zprávy zobrazí před oknem, které je aktuálně aktivní.

Viz také

Platí pro