加入动态添加了10个TextBox控件,我如何遍历获取他们的名字呢?
int name = new DateTime().Millisecond;
TextBox txtBox = new TextBox();
txtBox.Name = "txt" + name;
txtBox.Multiline = true;
txtBox.Size = new System.Drawing.Size(100, 25);
txtBox.Location = new Point(25 + count, 20 + count);
this.Controls.Add(txtBox);
int name = new DateTime().Millisecond;
TextBox txtBox = new TextBox();
txtBox.Name = "txt" + name;
txtBox.Multiline = true;
txtBox.Size = new System.Drawing.Size(100, 25);
txtBox.Location = new Point(25 + count, 20 + count);
this.Controls.Add(txtBox);
解决方案 »
- Xtragrid控件 行不能选择并且颜色变灰色!!!
- C和C#的接口探究问题
- 如何利用GDI+在PictureBox上,使用鼠标拖动绘制矩形框。
- winform中实现数据的增删改查问题
- 求封装sql2008数据库操作的C#源代码!还有封装了网络操作的C#源码!
- 无法连接数据库(各位哥哥姐姐请帮忙)
- 关于c#操作excel图表的中英文版本问题
- 急:vs.net怎么打包可以可选择地安装REALPLAYER或其他程序?
- load一个xml文件以后,如何立刻就将load的内容MessageBox.show出来啊?(内代码)
- 请教一个有文件上传的简单问题?(在线等待)
- 财付通购买Q币的C#实现
- 使用AxWebBrowser获取网页信息到剪贴板如何及时释放所占资源?
{
if(c is textbox)
{
textbox tb =(textbox)c;
messagebox.show(tb.name)
}
}
foreach(Control c in Controls)
{
temp=c as TextBox;
if(temp!=null)
{
messagebox.show(temp.Name)
}
}这样是不是能提高效率?