zoukankan      html  css  js  c++  java
  • 几种MDI窗体‘单例’显示代码

    几种

    public void CreatChildForm(string frm_ChildName)
      {
       string frm_Name="GainerMain."+frm_ChildName.Trim();
       foreach(Form frm_Temp in this.MdiChildren)
        if(frm_Temp.GetType().ToString() == frm_Name.Trim())
        {
         if(frm_Temp.WindowState == FormWindowState.Minimized)
         frm_Temp.WindowState = FormWindowState.Normal;
         frm_Temp.Focus();
         return;
        }
       
       Form frm_Child =(Form)Activator.CreateInstance(Type.GetType(frm_Name));
       frm_Child.MdiParent = this;
       frm_Child.Show();   
      }

      private void CreatChildForm(string frm_ChildName,string strType)
      {
       string frm_Name="GainerMain."+frm_ChildName.Trim();
       foreach(Form frm_Temp in this.MdiChildren)
        if(frm_Temp.GetType().ToString() == frm_Name.Trim())
        {
         if(frm_Temp.WindowState == FormWindowState.Minimized)
          frm_Temp.WindowState = FormWindowState.Normal;
         frm_Temp.Focus();
         return;
        }
       
       Form frm_Child =(Form)Activator.CreateInstance(Type.GetType(frm_Name));
       frm_Child.MdiParent = this;
       frm_Child.Show();
       frm_Child.Dock =System.Windows.Forms.DockStyle.Fill;//平铺,最大化
      }

     private void ShowChildMDIEx(string strFrmModleName , string strTitle)
            {
                string strAssembly = "Dhthx.TicketOffice.dll";
                string frmName = strFrmModleName;
                foreach (Form frmTemp in this.MdiChildren)
                    if (frmTemp.GetType().ToString() == frmName.Trim())
                    {
                        if (frmTemp.WindowState == FormWindowState.Minimized)
                            frmTemp.WindowState = FormWindowState.Normal;
                        frmTemp.Close();
                    }

                Assembly assembly = Assembly.LoadFrom(Application.StartupPath + "\\" + strAssembly);
                Type type = assembly.GetType(frmName);
                Form frmChild = (Form)Activator.CreateInstance(type);
                frmChild.MdiParent = this;
                frmChild.WindowState = FormWindowState.Normal;
                frmChild.Show();
                frmChild.Dock = System.Windows.Forms.DockStyle.Fill;//平铺,最大化
      }

  • 相关阅读:
    图形学基础教程09--骨骼动画原理 (带演示程序)
    图形学基础教程08--光栅化原理
    图形学基础教程07--渲染到纹理 (带演示程序)
    图形学基础教程06--渲染状态二 (带演示程序)
    图形学基础教程05--渲染状态一 (带演示程序)
    图形学基础教程04--纹理和采样器 (带演示程序)
    图形学基础教程03--矩阵变换和光照 (带演示程序)
    图形学基础教程02--顶点数据和SHADER寄存器 (带演示程序)
    图形学基础教程01--渲染管线 (带演示程序)
    Jquery 全选、反选问题解析
  • 原文地址:https://www.cnblogs.com/spymaster/p/889292.html
Copyright © 2011-2022 走看看