You can get Type with GetType () :
sender.GetType();
If you want to use it as a button, you can do it.
var myButton = sender as Button;
if(myButton != null)
var buttonTag = myButton.Tag;
Using asinstead (Button)sendermeans that instead of throwing an exception, if it cannot be selected as a button, it simply returns null. Then we can check if it is null and, if it is not null, we can access the Tag property.
source
share