I am trying to create a function so it gets the name of the button(sender) but I get this error.
System.InvalidCastException HResult=0x80004002 to cast object of type
'Bunifu.Framework.UI.BunifuFlatButton' to type
'Bunifu.UI.WinForms.BunifuButton.BunifuButton'
Code:
using Bunifu.UI.WinForms.BunifuButton;
private void Dashboard_Bt_Click(object sender, EventArgs e)
{
string objname = ((BunifuButton)sender).Name;
label1.Text = objname;
}
User contributions licensed under CC BY-SA 3.0