System.Windows.Forms命名空间的MessageBox.show()用法大全
摘要:
// 显示消息窗口(也称为对话框)向用户展示消息。 这是一个模式窗口,可阻止应用程序中的其他操作,直到用户将其关闭。 System.Windows.Forms.MessageBox
// 可包含通知并指示用户的文本、按钮和符号。
//
// 摘要:
// 显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// displayHelpButton:
// 如果显示“帮助”按钮,则为 true;否则为 false。 默认值为 false。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool displayHelpButton);
//
// 摘要:
// 在指定对象的前面显示具有指定文本、标题和按钮的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons);
//
// 摘要:
// 在指定对象的前面显示具有指定文本、标题、按钮和图标的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
//
// T: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);
//
// 摘要:
// 在指定对象的前面显示具有指定文本、标题、按钮、图标和默认按钮的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T: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);
//
// 摘要:
// 在指定对象的前面显示具有指定文本、标题、按钮、图标、默认按钮和选项的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T: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);
//
// 摘要:
// 显示具有指定文本的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
public static DialogResult Show(string text);
//
// 摘要:
// 显示具有指定文本和标题的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
public static DialogResult Show(string text, string caption);
//
// 摘要:
// 显示具有指定文本、标题和按钮的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 指定的参数不是成员的 System.Windows.Forms.MessageBoxButtons。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons);
//
// 摘要:
// 显示具有指定文本、标题、按钮和图标的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 指定的参数不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 指定的参数不是成员的
// System.Windows.Forms.MessageBoxIcon。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon);
//
// 摘要:
// 在指定对象的前面显示具有指定文本和标题的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
public static DialogResult Show(IWin32Window owner, string text, string caption);
//
// 摘要:
// 显示具有指定文本、标题、按钮、图标和默认按钮的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T: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);
//
// 摘要:
// 使用指定的帮助文件、HelpNavigator 和帮助主题显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// navigator:
// System.Windows.Forms.HelpNavigator 值之一。
//
// param:
// 用户单击“帮助”按钮时显示的帮助主题的数值 ID。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param);
//
// 摘要:
// 使用指定的帮助文件、HelpNavigator 和帮助主题显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// navigator:
// System.Windows.Forms.HelpNavigator 值之一。
//
// param:
// 用户单击“帮助”按钮时显示的帮助主题的数值 ID。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
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 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// navigator:
// System.Windows.Forms.HelpNavigator 值之一。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator);
//
// 摘要:
// 使用指定的帮助文件和 HelpNavigator 显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// navigator:
// System.Windows.Forms.HelpNavigator 值之一。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator);
//
// 摘要:
// 使用指定的帮助文件和帮助关键字显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// keyword:
// 在用户单击“帮助”按钮时显示的帮助关键字。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword);
//
// 摘要:
// 使用指定的帮助文件和帮助关键字显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// keyword:
// 在用户单击“帮助”按钮时显示的帮助关键字。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword);
//
// 摘要:
// 使用指定的帮助文件显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath);
//
// 摘要:
// 使用指定的帮助文件显示一个具有指定文本、标题、按钮、图标、默认按钮、选项和“帮助”按钮的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// helpFilePath:
// 用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath);
//
// 摘要:
// 显示具有指定文本、标题、按钮、图标、默认按钮和选项的消息框。
//
// 参数:
// text:
// 要在消息框中显示的文本。
//
// caption:
// 要在消息框的标题栏中显示的文本。
//
// buttons:
// System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。
//
// icon:
// System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
//
// defaultButton:
// System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。
//
// options:
// System.Windows.Forms.MessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。 若要使用默认值,请传入 0。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
//
// 异常:
// T:System.ComponentModel.InvalidEnumArgumentException:
// buttons 不是成员的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 不是成员的 System.Windows.Forms.MessageBoxIcon。
// - 或 - defaultButton 指定不是成员的 System.Windows.Forms.MessageBoxDefaultButton。
//
// T:System.InvalidOperationException:
// 尝试显示 System.Windows.Forms.MessageBox 在没有用户交互模式中运行的进程中。 这通过指定 System.Windows.Forms.SystemInformation.UserInteractive
// 属性。
//
// T:System.ArgumentException:
// options 指定同时 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。
// - 或 - buttons 指定了无效的组合 System.Windows.Forms.MessageBoxButtons。
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options);
//
// 摘要:
// 在指定对象的前面显示具有指定文本的消息框。
//
// 参数:
// owner:
// 将拥有模式对话框的 System.Windows.Forms.IWin32Window 的一个实现。
//
// text:
// 要在消息框中显示的文本。
//
// 返回结果:
// System.Windows.Forms.DialogResult 值之一。
public static DialogResult Show(IWin32Window owner, string text);
System.Windows.Forms命名空间的MessageBox.show()用法大全相关推荐
- System.IO.Directory.GetCurrentDirectory与System.Windows.Forms.Application.StartupPath的用法
.Net Framework中System.IO.Directory.GetCurrentDirectory()方法用于获得应用程序当前工作目录.如果使用此方法获得应用程序所在的目录,应该注意:Sys ...
- System.Timers.Timer与System.Windows.Forms.Timer 区别
根据msdn解释:System.Threading.Timer 是一个简单的轻量计时器,它使用回调方法并由线程池线程提供服务. 不建议将其用于 Windows 窗体,因为其回调不在用户界面线程上进行. ...
- System.Windows.Forms.Timer与System.Timers.Timer的区别
.NET Framework里面提供了三种Timer: System.Windows.Forms.Timer System.Timers.Timer System.Threading.Timer VS ...
- System.Windows.Forms.ListView
呈现一个 Windows 列表视图控件,并且能够以四种不同的视图中的任何一种来显示一个子项集合. 命名空间:System.Windows.Forms 汇编集:System.Windows.Forms( ...
- System.Windows.Forms.DataVisualization.Charting.Chart
//创建圖形式的ChartSystem.Windows.Forms.DataVisualization.Charting.Chart chart1 = new System.Windows.Forms ...
- 使用.net 6.0框架的WPF应用如何引用System.Windows.Forms这个dll
在.net 6.0的WPF应用中,想使用OpenFileDialog 这个类或者FolderBrowserDialog这个类,是无法找到System.Windows.Forms这个dll引用的,即使从 ...
- System.Windows.Forms.Timer在线程中的注意事项
在WinForm中使用System.Windows.Forms.Timer对象,如果是在单线程中使用,则直接设置该对象的Enabled属性值即可启动计时器,但如果是在多线程窗体中在多线程引发的事件中调 ...
- System.Windows.Forms.ListView : Control
#region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...
- C# WinForm编程之System.Windows.Forms.DataGridViewRow.DataBoundItem Property
Namespace: System.Windows.Forms Assembly: System.Windows.Forms.dll 获取用于填充行的数据绑定对象. 下面的代码示例演示如何使用 Dat ...
最新文章
- bae java_有人在BAE开发过java-tomcat应用吗?数据库老是链接失败
- 一行代码卖出 570 美元, 天价代码的内幕
- Eclipse中创建SpringBoot项目流程,及报错解决方案
- 计算机二级考试选择科目有级别,计算机二级考试该选哪一科目?
- pde中微元分析法的主要思想_初中数学常用的思想方法丨所有题型的考试技巧最全整理,高分必备...
- 【转】傅里叶分析之掐死教程(完整版)更新于2014.06.06
- mysql in优化_MySQL的一次优化记录 (IN子查询和索引优化)
- Spring AOP两种使用方式以及如何使用解析
- stm32 NVIC EXTI
- java nio 缓冲区(一)
- 视觉slam第一讲——
- vue中computed与watch的区别
- 风起云涌、战火通明,2019 年云计算大盘点
- 大学生圣诞网页设计制作成品 圣诞节静态HTML网页作业作品 简单DIV CSS布局网站
- Edxposed研究之Magisk源码下载编译的详细实战教程
- Ettercap网络嗅探工具攻略
- 腾讯首款区块链AR游戏上线《一起来捉妖》,风物志里的奇珍异兽
- 扎心!五成程序员年薪 10-20 万,超半数资深程序员薪资高于 20 万
- html视频播放卡顿,电脑网页看视频卡?来看看我的解决方法!
- Android 网页无法访问