Reputation: 1923
I am programming for Windows Phone 8.1.
When I click on a button, I Call cmdDeleteBlock_Click.
AddHandler cmdDelete(1).Click, AddressOf cmdDeleteBlock_Click
AddHandler cmdDelete(2).Click, AddressOf cmdDeleteBlock_Click
AddHandler cmdDelete(3).Click, AddressOf cmdDeleteBlock_Click
...
How can get name of button (ID) that was clicked in cmdDeleteBlock_Click.
Private Sub cmdDeleteBlock_Click(sender As Object, e As RoutedEventArgs)
' Get button name (Id) of button that clicked **here**
End Sub
Upvotes: 0
Views: 71
Reputation: 9380
You can get the name from the object received in the event handler. Stating an example in c#
protected void btn_click(object sender, RoutedEventArgs e)
{
string Name = ((Button)sender).Name;
}
Similarly you can get other properties as well.
Upvotes: 2