zoukankan      html  css  js  c++  java
  • MDI 窗体中打开子窗体的函数。

    代码如下:
    程序代码
      private void OpenChild(string Frmnamespace, string ChildTypeName)
            {
                int ret = 0;
                foreach (Form frm in MdiChildren)
                {
                    if (frm.GetType().Name == ChildTypeName)
                    {
                        frm.Activate();
                        ret = 1;
                        break;
                    }
                }
                if (0 == ret)
                {
                    string className = Frmnamespace + "." + ChildTypeName;
                    Form Instance = (Form) Assembly.Load(Frmnamespace).CreateInstance(className);
                    Instance.MdiParent = this;
                    Instance.Show();
                }
            }
    传入一个窗体,先检查这个窗体是不是有副本,如果有副本,则置前,否则新创建并显示.
    使用方法:
    程序代码
    private void LbtUserManager_ItemClick(object sender, ItemClickEventArgs e)
            {
                OpenChild("OuterRingRoad", "frmUserManager");
            }
            private void MenuUserPopdemod_ItemClick(object sender, ItemClickEventArgs e)
            {
                OpenChild("OuterRingRoad", "frmUserPopdemod");
            }
            private void MenuCurrentTimeData_ItemClick(object sender, ItemClickEventArgs e)
            {
                OpenChild("ORRTLB", "frmNowVDIInfo");
            }
            private void MenuCarCheckConfig_ItemClick(object sender, ItemClickEventArgs e)
            {
                OpenChild("ORRTLB", "frmVDISetting");
            }

  • 相关阅读:
    libjpeg的问题
    CURLcode的定义
    libcurl断点下载遇到的问题
    itunes connect
    node.js模块的坑
    itunes connect 改版后无法访问的处理办法
    cocos2d-x 在输入文字时点击语音crash
    Windows下LuaJIT的编译和使用
    多个so中模板单例的多次实例化
    多线程中避免使用信号量
  • 原文地址:https://www.cnblogs.com/bennylam/p/1590401.html
Copyright © 2011-2022 走看看