C#如何获得被点击控件的ID值
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/432
代码:
private void button1_Click(object sender, EventArgs e)
{
Button button = (Button)sender;
MessageBox.Show(button.Name);
}
参考来源:
https://zhidao.baidu.com/question/230748252.html
This article was last edited at 2020-08-21 14:40:12