日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

System.Windows.Forms命名空间的MessageBox.show()用法大全

發(fā)布時(shí)間:2025/5/22 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 System.Windows.Forms命名空间的MessageBox.show()用法大全 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

摘要:
??? //???? 顯示消息窗口(也稱為對(duì)話框)向用戶展示消息。 這是一個(gè)模式窗口,可阻止應(yīng)用程序中的其他操作,直到用戶將其關(guān)閉。 System.Windows.Forms.MessageBox
??? //???? 可包含通知并指示用戶的文本、按鈕和符號(hào)。

// // 摘要: // 顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // displayHelpButton: // 如果顯示“幫助”按鈕,則為 true;否則為 false。 默認(rèn)值為 false。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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); // // 摘要: // 在指定對(duì)象的前面顯示具有指定文本、標(biāo)題和按鈕的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // 返回結(jié)果: // System.Windows.Forms.DialogResult 值之一。 // // 異常: // T:System.ComponentModel.InvalidEnumArgumentException: // buttons 不是成員的 System.Windows.Forms.MessageBoxButtons。 // // T:System.InvalidOperationException: // 嘗試顯示 System.Windows.Forms.MessageBox 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons); // // 摘要: // 在指定對(duì)象的前面顯示具有指定文本、標(biāo)題、按鈕和圖標(biāo)的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon); // // 摘要: // 在指定對(duì)象的前面顯示具有指定文本、標(biāo)題、按鈕、圖標(biāo)和默認(rèn)按鈕的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton); // // 摘要: // 在指定對(duì)象的前面顯示具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕和選項(xiàng)的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 和 System.Windows.Forms.MessageBoxOptions.ServiceNotification。 // - 或 - options 指定 System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly 或 // System.Windows.Forms.MessageBoxOptions.ServiceNotification 指定中的值和 owner 參數(shù)。 僅當(dāng)調(diào)用不采用此方法的版本,則應(yīng)使用這兩個(gè)選項(xiàng) // owner 參數(shù)。 - 或 - buttons 指定了無效的組合 System.Windows.Forms.MessageBoxButtons。 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options); // // 摘要: // 顯示具有指定文本的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // 返回結(jié)果: // System.Windows.Forms.DialogResult 值之一。 public static DialogResult Show(string text); // // 摘要: // 顯示具有指定文本和標(biāo)題的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // 返回結(jié)果: // System.Windows.Forms.DialogResult 值之一。 public static DialogResult Show(string text, string caption); // // 摘要: // 顯示具有指定文本、標(biāo)題和按鈕的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // 返回結(jié)果: // System.Windows.Forms.DialogResult 值之一。 // // 異常: // T:System.ComponentModel.InvalidEnumArgumentException: // buttons 指定的參數(shù)不是成員的 System.Windows.Forms.MessageBoxButtons。 // // T:System.InvalidOperationException: // 嘗試顯示 System.Windows.Forms.MessageBox 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons); // // 摘要: // 顯示具有指定文本、標(biāo)題、按鈕和圖標(biāo)的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // 返回結(jié)果: // System.Windows.Forms.DialogResult 值之一。 // // 異常: // T:System.ComponentModel.InvalidEnumArgumentException: // buttons 指定的參數(shù)不是成員的 System.Windows.Forms.MessageBoxButtons。 - 或 - icon 指定的參數(shù)不是成員的 // System.Windows.Forms.MessageBoxIcon。 // // T:System.InvalidOperationException: // 嘗試顯示 System.Windows.Forms.MessageBox 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon); // // 摘要: // 在指定對(duì)象的前面顯示具有指定文本和標(biāo)題的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // 返回結(jié)果: // System.Windows.Forms.DialogResult 值之一。 public static DialogResult Show(IWin32Window owner, string text, string caption); // // 摘要: // 顯示具有指定文本、標(biāo)題、按鈕、圖標(biāo)和默認(rèn)按鈕的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton); // // 摘要: // 使用指定的幫助文件、HelpNavigator 和幫助主題顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // navigator: // System.Windows.Forms.HelpNavigator 值之一。 // // param: // 用戶單擊“幫助”按鈕時(shí)顯示的幫助主題的數(shù)值 ID。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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 和幫助主題顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // navigator: // System.Windows.Forms.HelpNavigator 值之一。 // // param: // 用戶單擊“幫助”按鈕時(shí)顯示的幫助主題的數(shù)值 ID。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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 顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // navigator: // System.Windows.Forms.HelpNavigator 值之一。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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 顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // navigator: // System.Windows.Forms.HelpNavigator 值之一。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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); // // 摘要: // 使用指定的幫助文件和幫助關(guān)鍵字顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // keyword: // 在用戶單擊“幫助”按鈕時(shí)顯示的幫助關(guān)鍵字。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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); // // 摘要: // 使用指定的幫助文件和幫助關(guān)鍵字顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // keyword: // 在用戶單擊“幫助”按鈕時(shí)顯示的幫助關(guān)鍵字。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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); // // 摘要: // 使用指定的幫助文件顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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); // // 摘要: // 使用指定的幫助文件顯示一個(gè)具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕、選項(xiàng)和“幫助”按鈕的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // helpFilePath: // 用戶單擊“幫助”按鈕時(shí)顯示的“幫助”文件的路徑和名稱。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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); // // 摘要: // 顯示具有指定文本、標(biāo)題、按鈕、圖標(biāo)、默認(rèn)按鈕和選項(xiàng)的消息框。 // // 參數(shù): // text: // 要在消息框中顯示的文本。 // // caption: // 要在消息框的標(biāo)題欄中顯示的文本。 // // buttons: // System.Windows.Forms.MessageBoxButtons 值之一,可指定在消息框中顯示哪些按鈕。 // // icon: // System.Windows.Forms.MessageBoxIcon 值之一,它指定在消息框中顯示哪個(gè)圖標(biāo)。 // // defaultButton: // System.Windows.Forms.MessageBoxDefaultButton 值之一,可指定消息框中的默認(rèn)按鈕。 // // options: // System.Windows.Forms.MessageBoxOptions 值之一,可指定將對(duì)消息框使用哪些顯示和關(guān)聯(lián)選項(xiàng)。 若要使用默認(rèn)值,請(qǐng)傳入 0。 // // 返回結(jié)果: // 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 在沒有用戶交互模式中運(yùn)行的進(jìn)程中。 這通過指定 System.Windows.Forms.SystemInformation.UserInteractive // 屬性。 // // T:System.ArgumentException: // options 指定同時(shí) 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); // // 摘要: // 在指定對(duì)象的前面顯示具有指定文本的消息框。 // // 參數(shù): // owner: // 將擁有模式對(duì)話框的 System.Windows.Forms.IWin32Window 的一個(gè)實(shí)現(xiàn)。 // // text: // 要在消息框中顯示的文本。 // // 返回結(jié)果: // System.Windows.Forms.DialogResult 值之一。 public static DialogResult Show(IWin32Window owner, string text);

?

總結(jié)

以上是生活随笔為你收集整理的System.Windows.Forms命名空间的MessageBox.show()用法大全的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。