使用什麼method可以使Child windows自動放大呢? |
答題得分者是:pceyes
|
chkkevin
一般會員 發表:34 回覆:64 積分:19 註冊:2007-05-17 發送簡訊給我 |
|
pceyes
尊榮會員 發表:70 回覆:657 積分:1140 註冊:2003-03-13 發送簡訊給我 |
網上隨便找來的, 自己試試吧!
[code delphi] procedure TCustomForm.MergeMenu(MergeState: Boolean); var AMergeMenu: TMainMenu; Size: Longint; FixMaximize: boolean; begin if not (fsModal in FFormState) and (Application.MainForm <> nil) and (Application.MainForm.Menu <> nil) and (Application.MainForm <> Self) and ((FormStyle = fsMDIChild) or (Application.MainForm.FormStyle <> fsMDIForm)) then begin AMergeMenu := nil; if not (csDesigning in ComponentState) and (Menu <> nil) and (Menu.AutoMerge or (FormStyle = fsMDIChild)) then AMergeMenu := Menu; FixMaximize := MergeState and (FormStyle = fsMDIChild) and (WindowState = wsMaximized); // The important change from the healthy MergeMenu from D4 // is that the Restore/RE-maximize are split up to match the // behavior described in the Win32 Help's wm_MDINext topic (at // the bottom). if FixMaximize then begin { Force MDI to put back the system menu of a maximized child } Size := ClientWidth (Longint(ClientHeight) shl 16); SendMessage(Handle, WM_SIZE, SIZE_RESTORED, Size); end; try with Application.MainForm.Menu do if MergeState then Merge(AMergeMenu) else Unmerge(AMergeMenu); finally if FixMaximize then begin Size := ClientWidth (Longint(ClientHeight) shl 16); SendMessage(Handle, WM_SIZE, SIZE_MAXIMIZED, Size); end; end; end; end; [/code]
------
努力會更接近成功 |
chkkevin
一般會員 發表:34 回覆:64 積分:19 註冊:2007-05-17 發送簡訊給我 |
|
pceyes
尊榮會員 發表:70 回覆:657 積分:1140 註冊:2003-03-13 發送簡訊給我 |
------
努力會更接近成功 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |