0

我正在尝试创建一个函数,以便它获取按钮(发件人)的名称,但出现此错误。

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;
    }
4

0 回答 0