Support.SetDefault(Button, Boolean) 方法

定義

警告

Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862

設定 AcceptButtonForm性質。

public:
 static void SetDefault(System::Windows::Forms::Button ^ btn, bool Default);
public static void SetDefault(System.Windows.Forms.Button btn, bool Default);
[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 SetDefault(System.Windows.Forms.Button btn, bool Default);
static member SetDefault : 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 SetDefault : System.Windows.Forms.Button * bool -> unit
Public Sub SetDefault (btn As Button, Default As Boolean)

參數

btn
Button

Button

Default
Boolean

true 若 Visual Basic 6.0 CommandButton 控制項的 Default 屬性為 true;否則 false

屬性

備註

在 Visual Basic 6.0 中,布林值 DefaultCancel 控制項的屬性 CommandButton 決定該控制鍵是否回應 ENTER 鍵或 ESC 鍵。 在 Visual Basic 中, Button 控制項不再擁有 DefaultCancel 屬性。 該 Form 物件擁有 AcceptButtonCancelButton 屬性,提供相同功能;這些屬性以控制項名稱 Button 作為參數。

升級工具會利用此函式,AcceptButton根據升級後的 Visual Basic 6.0 Form 控制項設定 a DefaultCommandButton 的屬性。

Note

Microsoft.VisualBasic.Compatibility.VB6 命名空間中的函式與物件,供工具從 Visual Basic 6.0 升級至 Visual Basic 2008 使用。 大多數情況下,這些函式和物件會重複你在 .NET Framework 中其他命名空間中能找到的功能。 只有當 Visual Basic 6.0 的程式碼模型與 .NET Framework 實作有顯著差異時,才需要使用這些工具。

適用於