您的位置:首页 > 编程语言 > C#

C#中使用控件数组

2007-06-20 10:24 411 查看
int iIndex;
Button[] btns = new Button[3];
for (iIndex = 1; iIndex <= 2; iIndex++)
{
btns[iIndex] = new Button();
btns[iIndex].Left = button1.Left;
btns[iIndex].Top = button1.Top + 100;
btns[iIndex].Visible = true;
this.Controls.Add(btns[iIndex]);
}

供大家学习之用,如有更好的,请多多指教!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: