我正在尝试创建一个函数,使其获得按钮(发送者)的名称,但出现此错误。
System.InvalidCastException HResult=0x80004002 to cast object of type
'Bunifu.Framework.UI.BunifuFlatButton' to type
'Bunifu.UI.WinForms.BunifuButton.BunifuButton'
代码:
using Bunifu.UI.WinForms.BunifuButton;
private void Dashboard_Bt_Click(object sender, EventArgs e)
{
string objname = ((BunifuButton)sender).Name;
label1.Text = objname;
}