首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

如何动态添加同一控件多次?

2012-02-16 
怎么动态添加同一控件多次?? ?谢谢...[解决办法]int ButtonIndex 0private void button1_Click(object

怎么动态添加同一控件多次?? ?
谢谢...

[解决办法]
int ButtonIndex = 0;
private void button1_Click(object sender, EventArgs e)
{
Button vButton = new Button();
vButton.Parent = this;
vButton.Text = "Zswang " + ButtonIndex;
vButton.Top = vButton.Height * ButtonIndex;
ButtonIndex++;
}

热点排行