This documentation is archived and is not being maintained.

Control.Enabled Property

Gets or sets a value indicating whether the control can respond to user interaction.

[Visual Basic]
Public Property Enabled As Boolean
public bool Enabled {get; set;}
public: __property bool get_Enabled();
public: __property void set_Enabled(bool);
public function get Enabled() : Boolean;
public function set Enabled(Boolean);

Property Value

true if the control can respond to user interaction; otherwise, false. The default is true.


The Enabled property allows controls to be enabled or disabled at run time. For example, you can disable controls that do not apply to the current state of the application. You can also disable a control to restrict its use. For example, a button can be disabled to prevent the user from clicking it. If a control is disabled, it cannot be selected.

When a container control has its enabled property set to false, all its contained controls are disabled, as well. For example, if the user clicks on any of the controls contained in a disabled GroupBox control, no events are raised.

Note   When a scrollable control is disabled, the scroll bars are also disabled. For example, a disabled multiline textbox is unable to scroll to display all the lines of text.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Control Class | Control Members | System.Windows.Forms Namespace | ScrollableControl