• winform窗体中查找控件


         private RichTextBox FindControl()
            {

                RichTextBox ret = null;
                try
                {
                    Control[] controls = Application.OpenForms["MainForm"].Controls.Find("txtContent", false);
                    if (controls != null && controls.Length > 0)
                    {
                        foreach (Control cn in controls)
                        {
                            if (cn is RichTextBox)
                            {
                                ret = (cn as RichTextBox);
                                break;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                }
                return ret;
            }

  • 相关阅读:
    002: Opencv 4.0代码执行
    Opencv4.0+cmake3.13.3+vs2017源码编译
    ubuntu 18.0Lts +YouCompleteMe插件安装
    pip 安装keras
    pip 安装paddle
    pip 安装 tensorboardX
    pip 安装pytorch 命令
    TT信息-4-Spring Boot/Spring Cloud
    TT信息-3-Spring/Spring MVC
    TT信息-2设计模式
  • 原文地址:https://www.cnblogs.com/xiaogongzhu/p/3826309.html
Copyright © 2020-2023  润新知