Dd <dirty.bbs@cszone.cc.ntu.edu.tw> 次寫入到主題
<3ScZ9b$v1c@cszone.cc.ntu.edu.tw>...
> ※ 引述《jmt.bbs@bbs.pu.edu.tw (AnyBodyHome?!)》之銘言:
> : question: maximize mdi child frame at new documentation..
> : 請問如何讓MDI的child frame 自動最大化?
> : i try to add "cs.style|=WS_MAXIMIZE;" in "PreCreateWindow()"
> : but it doesn't work :<
> try ModifyStyle()
>
The style WS_MAXIMIZE is not to make the window to be maximized
at its creation but to allow a maximized button in the title
bar as well as a MAXIMIZE command in the system menu.
Of course, it won't work in your case. In fact, a simple way to
maximize the MDI child window using MFC without overriding any
function is to issue the following line:
AfxGetMainWnd()->MDIMaximize(AfxGetMainWnd()->MDIGetActive(NULL));
You may place this above line at any place in your program after
calls to OnFileNew() or OpenDocumentFile() to maximize the new created
child window, as it would be the current active MDI window.
-- 市隱
> -------------------------------------------------------------------------- <
發信人: jmt.bbs@bbs.pu.edu.tw (:o), 看板: Programming
標 題: Re: [mfc]maximize mdi child frame at new docu
發信站: 靜宜BBS站 (Tue Jan 26 17:01:19 1999)
轉信站: Ptt!news.ntu!feeder.seed.net.tw!spring!ctu-gate!news.nctu!news.cis.nct
【 在 dirty.bbs@cszone.cc.ntu.edu.tw (Dd) 的大作中提到: 】
: ※ 引述《jmt.bbs@bbs.pu.edu.tw (AnyBodyHome?!)》之銘言:
: : question: maximize mdi child frame at new documentation..
: : 請問如何讓MDI的child frame 自動最大化?
: : i try to add "cs.style|=WS_MAXIMIZE;" in "PreCreateWindow()"
: : but it doesn't work :<
: try ModifyStyle()
thx for ur reply, i finally fixed it by:
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
//CMDIChildWnd::ActivateFrame(nCmdShow);
CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED);
}
--
|...... | ._ http://members.tripod.com/~xpa32/index.htm
|...... | / \ /\__/ \__/
\ ------\-\ .' O \ / / \ \
(______ `._.' | } \/~~
\--~-.__| /\_____ | /- _ `..-'---______
|_____| |_____| \---- ~ - . _ _ _ _ _
※ 來源:‧靜宜大學計算機中心BBS站 bbs.pu.edu.tw‧[FROM: gate4.gv.com.tw]