日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

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

發布時間:2025/5/22 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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()用法大全的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。