winform 用户控件事件的写法
2021-04-15 12:26
标签:partial use eve code click obj bsp rgs win winform 用户控件事件的写法 标签:partial use eve code click obj bsp rgs win 原文地址:https://www.cnblogs.com/gaocong/p/8886218.html public partial class UcTest : UserControl
{
public UcTest()
{
InitializeComponent();
}
//定义事件
public event EventHandler UserControlBtnClicked;
private void btn_Click(object sender, EventArgs e)
{
UserControlBtnClicked?.Invoke(sender, new EventArgs());//把按钮自身作为参数传递
}
}