zoukankan      html  css  js  c++  java
  • 一个很不好解决的问题 哟(control类型到combobox或到textbox的转换)

    目的:在一panal上面有三个combobox,我想查找一个名称为:number 看其是否为这三个combobox中的一个,如是为其中一个,则将一系列一字符值给他;
    查找函数:
     private System.Windows.Forms.Control findControl(System.Windows.Forms.Control control, string controlName)
            {           
                Control c1;           
                foreach (Control c in control.Controls)
                {
                    if (c.Name == controlName)
                    {                                   
                        //*********************************************************************************************************************
                            问题的出现地;
          在这里需要将:
          c.item.add("111");
                            c.item.add("222");    现在时:c它没有item属性,仅有text属性
                            c.item.add("333");                      
                        //*********************************************************************************************************************
                        return c;
                    }
                    else if (control.Controls.Count > 0)
                    {
                        c1 = findControl(c, controlName);
                        if (c1 != null)
                        {
                            return c1;
                        }
                    }
                }
                return null;
            }    
    急盼回信;

  • 相关阅读:
    mysql 中只能使用 localhost 登录,用ip不能登陆
    在springboot 和 mybatis 项目中想要显示sql 语句进行调试
    从一张表数据导入到另一张表
    mysql 中 delete 子查询的限制
    配置eureka 老是报错connected time out 或者 refused connected
    Linux-TCP 出现 RST 的几种情况
    MySQL-优化之 index merge(索引合并)
    Python-Mac 安装 PyQt4
    PHP-PHP-FPM的max_children一些误区
    Linux-磁盘及网络IO工作方式解析
  • 原文地址:https://www.cnblogs.com/gxy19fly/p/812854.html
Copyright © 2011-2022 走看看