在winform中循环查找textbox是否为数字,因为textbox很多,怎样循环查找验证 遍历所有的控件,如果他的类型返回值是textbox, 在验证里面的值是否是数字类型! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //假定文本框都直接再窗体上foreach(System.Windows.Forms.TextBox tempControl in this.Controls ){ if(isNum(tempControl.Text)) { } else {}} string strNum = string.Empty;//穷举所有的控件foreach( Control ctrl in this.Controls) if( ctrl is TextBox) { //获得该TextBox的Text strNum = ((TextBox)ctrl).Text; ............. } 如果涉及嵌套,例如textbox在panel上,还需要使用递归算法 get a masked textbox:http://www.thecodeproject.com/cs/miscctrl/maskedcsedit.asphttp://www.c-sharpcorner.com/Code/2004/Jan/MaskedTextBoxControl.asp 利用API函数SendMessage在Picturebox控件中插入图片 C#图片存入Access怎么说SQL语法错误呀?哪位高手看看? 如果根据一个对象,求出一个唯一值? 有关bitmap和picturebox的问题 如何在C#中实现批处理的功能?!急!!!! C#中如何将URL中的一副图片显示提取并显示到 PictureBox控件中? 客户端给服务器端发送信息,服务器接受不到~请大神帮忙 !有可能是颜色的部分出错,帮忙找下啊 大神 下边的内容为什么不响应 算法 在线等 关于C#的问题 如何在ASP.NET中实现进度条? 关于各位回贴时的一点看法。。顺便散点分
foreach(System.Windows.Forms.TextBox tempControl in this.Controls )
{
if(isNum(tempControl.Text))
{
}
else
{}
}
foreach( Control ctrl in this.Controls)
if( ctrl is TextBox)
{
//获得该TextBox的Text
strNum = ((TextBox)ctrl).Text;
.............
}