共用方式為


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 CommandButton 控制項設定 a FormDefault 的屬性。

備註

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

適用於