This documentation is archived and is not being maintained.

Support.SetDefault Method

Sets the AcceptButton property of a Form.

Namespace: Microsoft.VisualBasic.Compatibility.VB6
Assembly: Microsoft.VisualBasic.Compatibility (in microsoft.visualbasic.compatibility.dll)

public static void SetDefault (
	Button btn,
	bool Default
public static void SetDefault (
	Button btn, 
	boolean Default
public static function SetDefault (
	btn : Button, 
	Default : boolean
Not applicable.



A Button.


true if the Visual Basic 6.0 CommandButton control's Default property is true; otherwise false.

In Visual Basic 6.0, the Boolean Default and Cancel properties of a CommandButton control determine whether the control responds to the ENTER or ESC keys, respectively. In Visual Basic Code Name "Orcas", the Button control no longer has Default or Cancel properties. The Form object has AcceptButton and CancelButton properties that provide the same functionality; these properties take the name of a Button control as an argument.

This function is used by the upgrade tools to set the AcceptButton property of a Form.based on the Default property of an upgraded Visual Basic 6.0 CommandButton control.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0