内容显示页
 
类别:.Net + C# | 浏览(2717) | 2008-11-3 11:19:40

//遍历窗体上所有CheckBox控件 .net winform

StringBuilder sb = new StringBuilder();
foreach (Control c in Controls)
{
    if (c is CheckBox)
    {
        if (((CheckBox)c).Checked == true)
        {
            sb.Append(",");
            sb.Append(c.Text.ToString());
        }
    }
}
sb.Append(",");

textBox1.Text = sb.ToString();

 


引用本页地址:http://www.yongfa365.com/item/Bian-Li-winform-CheckBox-Controls.html
 
 
相关链接
 
网友评论:
1 青海 - 2010-6-23 10:50:15
很实用!学习了!谢谢!
 
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片 看不清? 换张图试试
 
     
 
 
文章分类
 
 
.Net + C#(73)
 
 
ASP+VBS(161)
 
 
 
Linux(10)
 
 
 
web 2.0(26)
 
 
 
 
 
心程(68)
 
生活(97)
 
 
     

Power by :柳永法(yongfa365)'Blog  | 京ICP备07011491号  QQ:64049027  E-mail:64049027@qq.com yongfa365'CodePlex yongfa365'CodeGoogle

申请友情链接 要求:跟本站主题相类似正规网站,双方交换为首页位置

转载请注明来源,以便后人及时得到最新、修正、加强版!!!