110,538
社区成员
发帖
与我相关
我的任务
分享
List<Button> btnList = new List<Button>(){
button1,button2
};
for (int i = 0; i < btnList.Count; i++)
{
if (btnList[i].Name == "button" + (i+1).ToString())
{
MessageBox.Show(btnList[i].Text);
}
}