MessageBox.Show Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menampilkan kotak pesan.
Overload
| Nama | Deskripsi |
|---|---|
| Show(String) |
Menampilkan kotak pesan yang memiliki pesan dan yang mengembalikan hasil. |
| Show(String, String) |
Menampilkan kotak pesan yang memiliki keterangan bilah pesan dan judul; dan yang mengembalikan hasil. |
| Show(Window, String) |
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan dan mengembalikan hasil. |
| Show(String, String, MessageBoxButton) |
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, dan tombol; dan yang mengembalikan hasil. |
| Show(Window, String, String) |
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan keterangan bilah pesan dan judul; dan mengembalikan hasil. |
| Show(String, String, MessageBoxButton, MessageBoxImage) |
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, tombol, dan ikon; dan yang mengembalikan hasil. |
| Show(Window, String, String, MessageBoxButton) |
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, dan tombol; dan juga mengembalikan hasil. |
| Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult) |
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, tombol, dan ikon; dan yang menerima hasil kotak pesan default dan mengembalikan hasil. |
| Show(Window, String, String, MessageBoxButton, MessageBoxImage) |
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, tombol, dan ikon; dan juga mengembalikan hasil. |
| Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions) |
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, tombol, dan ikon; dan yang menerima hasil kotak pesan default, mematuhi opsi yang ditentukan, dan mengembalikan hasil. |
| Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult) |
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, tombol, dan ikon; dan menerima hasil kotak pesan default dan mengembalikan hasilnya. |
| Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions) |
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, tombol, dan ikon; dan menerima hasil kotak pesan default, mematuhi opsi yang ditentukan, dan mengembalikan hasilnya. |
Keterangan
Gunakan kelebihan beban Show metode, yang memungkinkan Anda menentukan jendela pemilik. Jika tidak, kotak pesan dimiliki oleh jendela yang saat ini aktif.
Show(String)
Menampilkan kotak pesan yang memiliki pesan dan yang mengembalikan hasil.
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
Parameter
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Contoh
Contoh berikut menunjukkan cara menggunakan kelebihan beban Show metode ini.
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
Berlaku untuk
Show(String, String)
Menampilkan kotak pesan yang memiliki keterangan bilah pesan dan judul; dan yang mengembalikan hasil.
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
Parameter
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Contoh
Contoh berikut menunjukkan cara menggunakan kelebihan beban Show metode ini.
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
Berlaku untuk
Show(Window, String)
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan dan mengembalikan hasil.
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
Parameter
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Keterangan
Secara default, kotak pesan muncul di depan jendela yang saat ini aktif.
Lihat juga
Berlaku untuk
Show(String, String, MessageBoxButton)
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, dan tombol; dan yang mengembalikan hasil.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Contoh
Contoh berikut menunjukkan cara menggunakan kelebihan beban Show metode ini.
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
Berlaku untuk
Show(Window, String, String)
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan keterangan bilah pesan dan judul; dan mengembalikan hasil.
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
Parameter
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Keterangan
Secara default, kotak pesan muncul di depan jendela yang saat ini aktif.
Lihat juga
Berlaku untuk
Show(String, String, MessageBoxButton, MessageBoxImage)
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, tombol, dan ikon; dan yang mengembalikan hasil.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
- icon
- MessageBoxImage
Nilai MessageBoxImage yang menentukan ikon yang akan ditampilkan.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Contoh
Contoh berikut menunjukkan cara menggunakan kelebihan beban Show metode ini.
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
Berlaku untuk
Show(Window, String, String, MessageBoxButton)
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, dan tombol; dan juga mengembalikan hasil.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Keterangan
Secara default, kotak pesan muncul di depan jendela yang saat ini aktif.
Lihat juga
Berlaku untuk
Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult)
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, tombol, dan ikon; dan yang menerima hasil kotak pesan default dan mengembalikan hasil.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
- icon
- MessageBoxImage
Nilai MessageBoxImage yang menentukan ikon yang akan ditampilkan.
- defaultResult
- MessageBoxResult
Nilai MessageBoxResult yang menentukan hasil default kotak pesan.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Contoh
Contoh berikut menunjukkan cara menggunakan kelebihan beban Show metode ini.
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
Berlaku untuk
Show(Window, String, String, MessageBoxButton, MessageBoxImage)
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, tombol, dan ikon; dan juga mengembalikan hasil.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
- icon
- MessageBoxImage
Nilai MessageBoxImage yang menentukan ikon yang akan ditampilkan.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Keterangan
Secara default, kotak pesan muncul di depan jendela yang saat ini aktif.
Lihat juga
Berlaku untuk
Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions)
Menampilkan kotak pesan yang memiliki pesan, keterangan bilah judul, tombol, dan ikon; dan yang menerima hasil kotak pesan default, mematuhi opsi yang ditentukan, dan mengembalikan hasil.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
- icon
- MessageBoxImage
Nilai MessageBoxImage yang menentukan ikon yang akan ditampilkan.
- defaultResult
- MessageBoxResult
Nilai MessageBoxResult yang menentukan hasil default kotak pesan.
- options
- MessageBoxOptions
Objek MessageBoxOptions nilai yang menentukan opsi.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Contoh
Contoh berikut menunjukkan cara menggunakan kelebihan beban Show metode ini.
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
Berlaku untuk
Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult)
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, tombol, dan ikon; dan menerima hasil kotak pesan default dan mengembalikan hasilnya.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
- icon
- MessageBoxImage
Nilai MessageBoxImage yang menentukan ikon yang akan ditampilkan.
- defaultResult
- MessageBoxResult
Nilai MessageBoxResult yang menentukan hasil default kotak pesan.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Keterangan
Secara default, kotak pesan muncul di depan jendela yang saat ini aktif.
Lihat juga
Berlaku untuk
Show(Window, String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions)
Menampilkan kotak pesan di depan jendela yang ditentukan. Kotak pesan menampilkan pesan, keterangan bilah judul, tombol, dan ikon; dan menerima hasil kotak pesan default, mematuhi opsi yang ditentukan, dan mengembalikan hasilnya.
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
Parameter
- button
- MessageBoxButton
Nilai MessageBoxButton yang menentukan tombol atau tombol mana yang akan ditampilkan.
- icon
- MessageBoxImage
Nilai MessageBoxImage yang menentukan ikon yang akan ditampilkan.
- defaultResult
- MessageBoxResult
Nilai MessageBoxResult yang menentukan hasil default kotak pesan.
- options
- MessageBoxOptions
Objek MessageBoxOptions nilai yang menentukan opsi.
Mengembalikan
Nilai MessageBoxResult yang menentukan tombol kotak pesan mana yang diklik oleh pengguna.
- Atribut
Keterangan
Secara default, kotak pesan muncul di depan jendela yang saat ini aktif.
Lihat juga
- Activated
- Show(String, String, MessageBoxButton, MessageBoxImage, MessageBoxResult, MessageBoxOptions)