2013-04-23 43 views
-1

我有一個使用MDI窗體的應用程序,並且我一直在嘗試創建子項創建效果,並且使用Animatewindow()Delphi使用AnimateWindow創建最大化的MDI子項目

我的問題是,我所有的MDI形式與Windowstate=wsMaximized,不知道如何不顯示默認的經典窗口調整大小和與動畫創建表單......

這是什麼我嘗試:

procedure FORMCREATOR(t_form:tformclass); 
var form:tform; 
begin 
    frmain.sPanel5.Hide; 
    frmain.LockClientWindowUpdate;  
    form:=t_form.Create(frmain); 

//順便說一句,如果我這樣做,而不是 「t_form.Create(應用程序)」, 「t_form.Create(frmain);」它給出了一個錯誤..並與「....(frmain)」我不能訪問形式像「form.button1.caption:='測試'」這個程序之外,訪問衝突! ..幫助plox!

frmain.UnlockClientWindowUpdate; 

    AnimateWindow(form.Handle,500,AW_CENTER or AW_SLIDE or AW_VER_POSITIVE); 
end; 

所以,當我把這種,它只是創建表單像沒有Animatewindow() ......它時,才顯示最大無作用:(..

夥計們,請給我一個小手! 感謝

+0

沒有答案,因爲它不是可用的,但也許是一個playgroud:With TForm4.Create(self)do begin Formstyle:= fsNormal; visible:= false; Width:= Application.Mainform.ClientWidth; 高度:= Application.Mainform.ClientWidth; 父母:=自我; AnimateWindow(句柄,2000,AW_CENTER或AW_SLIDE或AW_VER_POSITIVE); 父母:=無; FormStyle:= fsMDIChild; 結束; – bummi 2013-04-23 15:23:40

+0

工程就像一個魅力..但我做了一些修改的代碼,我想發佈的解決方案..但我需要等待8小時? :/ – 2013-04-23 16:14:08

+1

是的:http://meta.stackexchange.com/questions/89063/answering-own-question-now-has-8-hour-limit但沒有必要着急... – bummi 2013-04-23 16:48:47

回答

0

隨着@bummi的想法..

我改變了這個:

procedure tfrmain.FORMCREATOR(t_form:tformclass); 
var form:tform; 
nome_form:string; 
begin 
    frmain.sPanel5.Hide;  

    frmain.lockClientWindowUpdate; 

    With t_form.Create(frmain) do 
    begin 
     visible := false; 
     Formstyle := fsNormal; //Now i'll make all my forms as fsnormal 
     Parent := self; 

     Width := frmain.sPanel5.width; 
     Height := frmain.sPanel5.height;  
     left:=frmain.sPanel5.left; 
     top:=frmain.sPanel5.Top; 

//這Spanel5是假定客戶區會在哪裏MDI子,這就是爲什麼我在程序

  frmain.UnlockClientWindowUpdate; 

     AnimateWindow(handle,1000, AW_CENTER or AW_SLIDE or AW_HOR_NEGATIVE); 

     frmain.lockClientWindowUpdate; 

     Parent := frmain; 
     FormStyle := fsMDIChild; 
     windowstate:=wsmaximized; 

     frmain.unlockClientWindowUpdate; 
    end;  
end; 

而且的beggining隱藏....是啊!它完美的作品,沒有圖像閃爍,這樣的事情! ;) 非常感謝!

相關問題