ButtonBase.Click ButtonBase.Click ButtonBase.Click ButtonBase.Click Event


Occurs when a button control is clicked.

public : event RoutedEventHandler Click
// Register
event_token Click(RoutedEventHandler const& handler) const;

// Revoke with event_token
void Click(event_token const& cookie) const;

// Revoke with event_revoker
Click_revoker Click(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler Click
Public Event Click As RoutedEventHandler
<button Click="eventhandler"/>


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

    <Button Content="Submit" 
    <TextBlock x:Name="textBlock1"/>
void submitButtonClick(object sender, RoutedEventArgs e)
    textBlock1.Text = "You clicked the Submit button.";
Private Sub submitButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBlock1.Text = "You clicked the Submit button."
End Sub

See also