本文整理匯總了C#中System.Windows.MessageBox.Show方法的典型用法代碼示例。如果您正苦於以下問題:C# MessageBox.Show方法的具體用法?C# MessageBox.Show怎麽用?C# MessageBox.Show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了MessageBox.Show方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShowMessageBoxButton_Click
private void ShowMessageBoxButton_Click(object sender, RoutedEventArgs e)
{
// Configure message box
string message = "Hello, MessageBox!";
// Show message box
MessageBoxResult result = MessageBox.Show(message);
}
示例2: ShowMessageBoxButton_Click
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);
}
示例3: ShowMessageBoxButton_Click
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);
}
示例4: ShowMessageBoxButton_Click
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);
}
示例5: ShowMessageBoxButton_Click
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);
}
示例6: ShowMessageBoxButton_Click
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);
}