ButtonBase Class

ButtonBase Class

Represents the base class for all Button controls.

Namespace:  System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

public ref class ButtonBase abstract : public ContentControl, 
This class is abstract; see Inheritance Hierarchy for derived non-abstract classes usable in XAML.

Handle the Click event to respond when the user clicks a ButtonBase. The user can raise the Click event by using an AccessText or by pressing ENTER or the SPACEBAR when the control has focus. When the user presses the SPACEBAR, the control sets IsPressed to true and captures the mouse. As a result, the control will raise mouse events such as MouseEnter and IsMouseDirectlyOverChanged. Note that using the AccessText or ENTER does not change IsPressed or capture the mouse, but it does raise the Click event.

The ButtonBase sets the AcceptsReturn attached property to true.

The ButtonBase sets the IsInputMethodEnabled property to false.

Content Model:  ButtonBase is a ContentControl. Its content property is Content. For more information on the content model for ButtonBase, see Controls Content Model Overview.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

© 2015 Microsoft