zoukankan      html  css  js  c++  java
  • delphi 判断MDI窗体的子窗体是否存在

    //***************************************************************************//函 数名: CreateForm
    //返 回值: boolean 
    //参 数: TForm 
    //功 能: 判断MDI窗体的子窗体是否存在 //***************************************************************************
    function TForm1.CreateFor(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;
  • 相关阅读:
    面向过程思想理解:
    Ajax的get请求向服务器请求数据五步骤?
    什么是Ajax无刷新技术?
    Ajax和JavaScript的区别
    为什么要用ajax
    好文章分享
    easyui系列之表单二Combogrid,Form,filebox,CheckBox(3)
    属性vs字段的关系
    jQuery-Load方法
    .Net 百度经纬度转高德
  • 原文地址:https://www.cnblogs.com/blogpro/p/11339058.html
Copyright © 2011-2022 走看看