Support.SetDefault(Button, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862
設定 AcceptButton 的 Form性質。
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)
參數
- Default
- Boolean
true 若 Visual Basic 6.0 CommandButton 控制項的 Default 屬性為 true;否則 false。
- 屬性
備註
在 Visual Basic 6.0 中,布林值 Default 與 Cancel 控制項的屬性 CommandButton 決定該控制鍵是否回應 ENTER 鍵或 ESC 鍵。 在 Visual Basic 中, Button 控制項不再擁有 Default 或 Cancel 屬性。 該 Form 物件擁有 AcceptButton 和 CancelButton 屬性,提供相同功能;這些屬性以控制項名稱 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 實作有顯著差異時,才需要使用。