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;
            }    
    急盼回信;

  • 相关阅读:
    .NET 6.0 —— 网络监视器 (TODO)
    Google adwords api —— report & AWQL
    Linux 镜像更新 为国内镜像源 for debian
    优化代码 —— 二八法则 & 编完代码,再优化
    鳥哥的 Linux 私房菜 ——— 第十八章、 服务的防火墙管理 xinetd, TCP Wrappers(3)
    端口号port 是什么
    aptget的install、update、upgrade的区别(转发)
    Google ads api —— github
    .net 6.00 —— record 类型 (TODO)
    Compiled models —— .NET Core 6.0
  • 原文地址:https://www.cnblogs.com/gxy19fly/p/812854.html
Copyright © 2011-2022 走看看