c# 确认窗口 confirm 实现

来源:互联网 发布:php批量上传图片插件 编辑:程序博客网 时间:2024/05/22 05:33

if (MessageBox.Show("信息", "标题", MessageBoxButtons.YesNo) == DialogResult.Yes) 
{
   //点确定后的逻辑
}

附:MessageBox.Show的重载方法

namespace System.Windows.Forms
{
    
// 摘要:
    
//     显示可包含文本、按钮和符号(通知并指示用户)的消息框。
    public class MessageBox
    
{
        
// 摘要:
        
//     显示具有指定文本的消息框。
        
//
        
// 参数:
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        public static DialogResult Show(string text);
        
//
        
// 摘要:
        
//     在指定对象的前面显示具有指定文本的消息框。
        
//
        
// 参数:
        
//   Text:
        
//     要在消息框中显示的文本。
        
//
        
//   Owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        public static DialogResult Show(IWin32Window owner, string text);
        
//
        
// 摘要:
        
//     显示具有指定文本和标题的消息框。
        
//
        
// 参数:
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        public static DialogResult Show(string text, string caption);
        
//
        
// 摘要:
        
//     在指定对象的前面显示具有指定文本和标题的消息框。
        
//
        
// 参数:
        
//   owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        public static DialogResult Show(IWin32Window owner, string text, string caption);
        
//
        
// 摘要:
        
//     显示具有指定文本、标题和按钮的消息框。
        
//
        
// 参数:
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     指定的 buttons 参数不是 System.Windows.Forms.MessageBoxButtons 的成员。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons);
        
//
        
// 摘要:
        
//     在指定对象的前面显示具有指定文本、标题和按钮的消息框。
        
//
        
// 参数:
        
//   Owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   Caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons);
        
//
        
// 摘要:
        
//     显示具有指定文本、标题、按钮和图标的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     指定的 buttons 参数不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - 指定的 icon
        
//     参数不是 System.Windows.Forms.MessageBoxIcon 的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon);
        
//
        
// 摘要:
        
//     在指定对象的前面显示具有指定文本、标题、按钮和图标的消息框。
        
//
        
// 参数:
        
//   Text:
        
//     要在消息框中显示的文本。
        
//
        
//   Icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   Owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   Buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   Caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon);
        
//
        
// 摘要:
        
//     显示具有指定文本、标题、按钮、图标和默认按钮的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton 的成员。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton);
        
//
        
// 摘要:
        
//     在指定对象的前面显示具有指定文本、标题、按钮、图标和默认按钮的消息框。
        
//
        
// 参数:
        
//   Icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   Owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   Caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton 的成员。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton);
        
//
        
// 摘要:
        
//     显示具有指定文本、标题、按钮、图标、默认按钮和选项的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options);
        
//
        
// 摘要:
        
//     在指定对象的前面显示具有指定文本、标题、按钮、图标、默认按钮和选项的消息框。
        
//
        
// 参数:
        
//   Text:
        
//     要在消息框中显示的文本。
        
//
        
//   Icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   Options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   Owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   Buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框的默认按钮。
        
//
        
//   Caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton 的成员。
        
//
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - options
        
//     指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 或 System.Windows.Forms.MessageBoxOptions.ServiceNotification
        
//     并在 owner 参数中指定一个值。仅当调用不接受 owner 参数的该方法版本时,才使用这两个选项。- 或 - buttons 指定了无效的 System.Windows.Forms.MessageBoxButtons
        
//     组合。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options);
        
//
        
// 摘要:
        
//     显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   helpButton:
        
//     如果显示“帮助”按钮,则为 true;否则为 false。默认为 false。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool displayHelpButton);
        
//
        
// 摘要:
        
//     使用指定的帮助文件显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath);
        
//
        
// 摘要:
        
//     使用指定的帮助文件显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   Icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   Owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   Caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath);
        
//
        
// 摘要:
        
//     使用指定的帮助文件和 HelpNavigator 显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   navigator:
        
//     System.Windows.Forms.HelpNavigator 值之一。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator);
        
//
        
// 摘要:
        
//     使用指定的帮助文件和帮助关键字显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   keyword:
        
//     在用户单击“帮助”按钮时显示的帮助关键字。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword);
        
//
        
// 摘要:
        
//     使用指定的帮助文件和 HelpNavigator 显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   Icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   Navigator:
        
//     System.Windows.Forms.HelpNavigator 值之一。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   Owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   Caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator);
        
//
        
// 摘要:
        
//     使用指定的帮助文件和帮助关键字显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   keyword:
        
//     在用户单击“帮助”按钮时显示的帮助关键字。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword);
        
//
        
// 摘要:
        
//     使用指定的帮助文件、HelpNavigator 和帮助主题显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   param:
        
//     用户单击“帮助”按钮时显示的帮助主题的数值 ID。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   navigator:
        
//     System.Windows.Forms.HelpNavigator 值之一。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param);
        
//
        
// 摘要:
        
//     使用指定的帮助文件、HelpNavigator 和帮助主题显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
        
//
        
// 参数:
        
//   owner:
        
//     将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
        
//
        
//   param:
        
//     用户单击“帮助”按钮时显示的帮助主题的数值 ID。
        
//
        
//   helpFilePath:
        
//     用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
        
//
        
//   icon:
        
//     System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
        
//
        
//   options:
        
//     System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入
        
//     0。
        
//
        
//   caption:
        
//     要在消息框的标题栏中显示的文本。
        
//
        
//   buttons:
        
//     System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
        
//
        
//   navigator:
        
//     System.Windows.Forms.HelpNavigator 值之一。
        
//
        
//   defaultButton:
        
//     System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
        
//
        
//   text:
        
//     要在消息框中显示的文本。
        
//
        
// 返回结果:
        
//     System.Windows.Forms.DialogResult 值之一。
        
//
        
// 异常:
        
//   System.ArgumentException:
        
//     options 同时指定了 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和
        
//     System.Windows.Forms.MessageBoxOptions.ServiceNotification。- 或 - buttons
        
//     指定了无效的 System.Windows.Forms.MessageBoxButtons 组合。
        
//
        
//   System.ComponentModel.InvalidEnumArgumentException:
        
//     buttons 不是 System.Windows.Forms.MessageBoxButtons 的成员。- 或 - icon 不是 System.Windows.Forms.MessageBoxIcon
        
//     的成员。- 或 - 指定的 defaultButton 不是 System.Windows.Forms.MessageBoxDefaultButton
        
//     的成员。
        
//
        
//   System.InvalidOperationException:
        
//     试图在运行模式不是用户交互模式的进程中显示 System.Windows.Forms.MessageBox。这是由 System.Windows.Forms.SystemInformation.UserInteractive
        
//     属性指定的。
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param);
    }

}
原创粉丝点击