全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1334
推到 Plurk!
推到 Facebook!

使用什麼method可以使Child windows自動放大呢?

答題得分者是:pceyes
chkkevin
一般會員


發表:34
回覆:64
積分:19
註冊:2007-05-17

發送簡訊給我
#1 引用回覆 回覆 發表時間:2008-01-15 18:47:57 IP:218.254.xxx.xxx 訂閱
就如我們常見,當child windows縮小後,在windows的pull down menu中選擇已經縮小的child window
,之後就會放大回縮小之前的模樣。

請師兄們,再次幫忙~有勞
------
獨學無友則孤陋寡聞,相識滿天下能知天下事
小弟是來自香港的~~多多指教
pceyes
尊榮會員


發表:70
回覆:657
積分:1140
註冊:2003-03-13

發送簡訊給我
#2 引用回覆 回覆 發表時間:2008-01-16 15:01:27 IP:122.127.xxx.xxx 訂閱
網上隨便找來的, 自己試試吧!
[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

發送簡訊給我
#3 引用回覆 回覆 發表時間:2008-01-17 00:47:47 IP:218.254.xxx.xxx 訂閱
還未了解是否可行,但先行謝謝了~
------
獨學無友則孤陋寡聞,相識滿天下能知天下事
小弟是來自香港的~~多多指教
pceyes
尊榮會員


發表:70
回覆:657
積分:1140
註冊:2003-03-13

發送簡訊給我
#4 引用回覆 回覆 發表時間:2008-01-24 22:59:16 IP:122.127.xxx.xxx 訂閱
------
努力會更接近成功
系統時間:2024-04-20 3:51:53
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!