MDI children always maximized? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 03 March 2007 at 1:26am |
Hi,
How do I make sure that all MDI children inside a
CXTPTabClientWnd are always maximized - no matter what?
I have tried to override both PreCreateWindow and ActivateFrame:
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{ cs.style &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX); if (!CMDIChildWnd::PreCreateWindow(cs))
return FALSE; return TRUE;
} void CChildFrame::ActivateFrame(int nCmdShow /* = -1 */)
{ nCmdShow = SW_SHOWMAXIMIZED; CMDIChildWnd::ActivateFrame(nCmdShow);
} This works until the user preses the close button of one of the MDI frames. Then the remaining children are restored!
Any ideas? Thanks. |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
After reading https://forum.codejock.com/forum_posts.asp?TID=226 I found the optimal solution:
Just like Oleg writes, do this in CMainFrame::OnCreate():
pCommandBars->GetMenuBar()->SetFlags(xtpFlagHideMinimizeBox | xtpFlagHideMaximizeBox);
Then add this in each child frame:
void CChildFrame::ActivateFrame(int nCmdShow /* = -1 */)
{ nCmdShow = SW_SHOWMAXIMIZED; CMDIChildWnd::ActivateFrame(nCmdShow);
} Lol... it's always like this. You google like a freak and you find nothing. Then you post the question somewhere, and in the next couple of minutes you stumble upon the solution. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |