Support.SetCancel(Button, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862
設定 CancelButton 的 Form 屬性。
public:
static void SetCancel(System::Windows::Forms::Button ^ btn, bool Cancel);
public static void SetCancel (System.Windows.Forms.Button btn, bool Cancel);
[System.Obsolete("Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862")]
public static void SetCancel (System.Windows.Forms.Button btn, bool Cancel);
static member SetCancel : System.Windows.Forms.Button * bool -> unit
[<System.Obsolete("Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862")>]
static member SetCancel : System.Windows.Forms.Button * bool -> unit
Public Sub SetCancel (btn As Button, Cancel As Boolean)
參數
- Cancel
- Boolean
如果 Visual Basic 6.0 true
控制項的 CommandButton
屬性為 Cancel
,則為 true
,否則為 false
。
- 屬性
備註
在 Visual Basic 6.0 中,布林值Default
並Cancel
屬性的CommandButton
控制項可讓您判斷是否控制項回應 ENTER 或 ESC 鍵,分別。 在 Visual BasicButton控制項不再具有Default
或Cancel
屬性。 Form物件具有AcceptButton並CancelButton屬性,提供相同的功能,這些屬性會取得名稱Button控制項做為引數。
此函式供升級工具來設定CancelButton的屬性Form.based 上的Cancel
屬性已升級的 Visual Basic 6.0CommandButton
控制項。
注意
Microsoft.VisualBasic.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic 2008。 在大多數情況下,這些函式和物件會複製在 .NET Framework 其他命名空間中可以找到的功能。 只有當 Visual Basic 6.0 程式碼模型與 .NET Framework 實作有顯著差異時,才會需要這些函式和物件。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應