请问如何实现判断一个panel中的所有的textbox的值均为空?谢谢

libingzhg 2004-11-11 02:36:27
请问如何实现判断一个panel中的所有的textbox的值均为空?谢谢
...全文
63 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
哈哈007哈 2004-11-11
  • 打赏
  • 举报
回复

完全同意楼上的
foreach(Control c in this.panel1.Controls)
{
if ( c is TextBox )
if(((TextBox)c).Text == "")
{ }
}
brightheroes 2004-11-11
  • 打赏
  • 举报
回复
public bool isEmpty()
{
foreach(Control c in this.panel1.Controls)
{
if ( c is TextBox)
if (((TextBox)c).Text != "")
return false;
}

return true;
}
brightheroes 2004-11-11
  • 打赏
  • 举报
回复
foreach(Control c in this.panel1.Controls)
{
if ( c is TextBox)
((TextBox)c).Text = "";
}

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧