本文整理汇总了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);
}