首页  编辑  

MDI子窗口的显示和关闭问题

Tags: /超级猛料/VCL/Form,窗体/MDI界面窗体/   Date Created:

MDIӴڵʾ͹ر

ڱʱʹMDIڣΪೡʹǵ

ͳһʹMDIҲһЩĵط

עҲǵı̴鷳һЩҪעĵط

(һ)Ҫ㲻MDIӴڴԶĴбȥ

һУӴھͻԶ֡MDIӴڴԶ

бȥжMDIӴѽʾ

һĴֳһ⡣

رMDIӴں󣬲ܼ򵥵if FormChild1=nil then ...

жǷѽΪFree󲢲nilǸ

Чĵֵַǿĺжϣ

function TfrmMain.IsForm(formClass : string) : boolean;

{жϴǷѽfromClassǴڵַ'TForm2'}

var

 i : integer;

begin

 result := False;

 for i := 0 to Application.ComponentCount -1 do

 begin

   if (Application.Components[i].ClassName = formClass) then

   begin

     result := True;

     Break;

   end;

 end;

end;

ȻҲжϷMDIڡ

()һĴCloseʱĬ϶HideMDIӴCloseʱ

ĬMinimizeΪһ㴰һرӦMDI

ڵOnClose¼Action=caFree;ʹڴͷ

ע⣺㲻Action:=caHideرպҪʾͱ

CreateһβСķжϴǷѽûо

Ƚѽֱshow

()ڵ˵ϼһڡ˵Ϊ

ôڲӲ˵ڵWindowMenuΪڡ

˵һMDIӴʱڡ˵һ

ӴڱӲ˵ҵǰڶӦIJ˵ǰһǡ

ѡ˵ԽӦĴڵǰܷɣһҪע

ڡ˵ʱҪһӲ˵Ͳ