码迷,mamicode.com
首页 > 其他好文 > 详细

遍历combobox

时间:2017-08-01 16:33:06      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:div   this   string   class   typeof   each   user   nbsp   color   

foreach (Control ctm in this.Controls)
            {
                if (ctm.GetType() == typeof(ComboBox) && ctm.Text.ToString() == "")//ComBobox为空
                {
                    panelAdd.Controls.Remove(ctm);
                    iUser -= 1;
                }
            }

这里要注意的是,这类combobox大多在panel中,所以this 要改成所在panel的Name

   

遍历combobox

标签:div   this   string   class   typeof   each   user   nbsp   color   

原文地址:http://www.cnblogs.com/net-syc/p/7269054.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!