zoukankan      html  css  js  c++  java
  • Delphi判断MDI子窗体是否被创建

    2008-02-28 15:18

    //***************************************************************************

    //函 数 名: CreateForm

    //返 回 值: boolean

    //参       数: TForm

    //功       能: 判断MDI窗体的子窗体是否存在

    //***************************************************************************

    function TForm1.CreateForm(CForm:TForm):boolean;

    var

    i:integer;

    FormExist:boolean;

    begin

    FormExist:=false;

    if(CForm=Nil) then     //判断CFrom是否为空

        begin

         CreateForm:=false; //函数返回值赋false

         exit;               //退出本函数

        end;

    for i:=0 to Screen.FormCount-1 do                     //判断窗体是否已经建立起来

        begin

         if Screen.Forms[i].ClassType=CForm.ClassType then //判断窗体存在

           FormExist:=true;

        end;

    if FormExist=false then

       begin

         CreateForm:=false; //函数返回值赋false

         exit;               //退出本函数

        end;

       if CForm.WindowState=wsMinimized then

        ShowWindow(CForm.Handle,SW_SHOWNORMAL) //显示窗体

        else

        ShowWindow(CForm.Handle,SW_SHOWNA);    //显示窗体

    if not CForm.Visible then

        CForm.Visible:=true;

    CForm.BringToFront;                     //当前窗口显示在最前面

    CForm.SetFocus;

    CreateForm:=true;

    end;

  • 相关阅读:
    flask数据库
    python 百万级别类实例实现节省内存
    python定义一种新类型的元组
    python使用临时文件
    open函数 文件设置缓冲
    词频统计,字典成绩排序
    列表数组集合解析
    2019蓝桥杯Java第十题大学生B组——最短路径思想
    项目企业信息图谱分析有感——数据分析
    需求分析有感
  • 原文地址:https://www.cnblogs.com/blogpro/p/11446282.html
Copyright © 2011-2022 走看看