ButtonBase.Click Event

Definition

Occurs when a button control is clicked.

C#
public event RoutedEventHandler Click;
XAML
<button Click="eventhandler"/>

Event Type

Examples

The following example demonstrates handling the Click event and setting the IsEnabled property of a Button, which inherits from ButtonBase.

XAML
<StackPanel>   
    <Button Content="Submit" 
            Click="submitButtonClick"/>
    <TextBlock x:Name="textBlock1"/>
</StackPanel>
C#
void submitButtonClick(object sender, RoutedEventArgs e)
{
    textBlock1.Text = "You clicked the Submit button.";
}

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also