我如何在while语句中创建按钮 [英] how Can i Create button in a while statement

查看:75
本文介绍了我如何在while语句中创建按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在我的小程序中有一个while语句,我想创建按钮,直到while语句正常工作

我该怎么做?





hi every one , i have a while statement in my little program and i want to create button until the while statement is working
how can i do that ?


int Counter=0;
while(Counter<10)
{

// create button !

Counter++;
}

推荐答案

有什么问题:

What''s the problem with:
int Counter=0;
while(Counter<10)
{

// create button !
Button myButton = new Button();
myButton.ID = "btnNumber" + Counter;
myButton.Text = "btnNumber" + Counter;
somePlaceholderOrPanel.Controls.Add(myButton);

Counter++;
}


这篇关于我如何在while语句中创建按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆