How do I maximize a child frame in code?
-
Hi all, I am writting an MFC app using the Doc/View and MDI. I can't figure out how to maximize my child frame when it gets created such that the restore, minimize, and close buttons appear up on the menu bar. I can get the window to maximize, but the buttons do not appear. I'm sure it is probably something simple that I am missing, but I just can't figure it out. When I click the maximize button I get the buttons, but I can't figure out how to do it in code. Thanks, Mike
-
Hi all, I am writting an MFC app using the Doc/View and MDI. I can't figure out how to maximize my child frame when it gets created such that the restore, minimize, and close buttons appear up on the menu bar. I can get the window to maximize, but the buttons do not appear. I'm sure it is probably something simple that I am missing, but I just can't figure it out. When I click the maximize button I get the buttons, but I can't figure out how to do it in code. Thanks, Mike
-
I may have something messed up elsewhere, because that is what I was doing to maximize it before. I tried it in several locations in the OnCreateClient (I already was using this method to set up a splitter window) and I still don't get the buttons or the contol menu in the frame's menu bar. Any other ideas? Thanks, Mike
-
Hi all, I am writting an MFC app using the Doc/View and MDI. I can't figure out how to maximize my child frame when it gets created such that the restore, minimize, and close buttons appear up on the menu bar. I can get the window to maximize, but the buttons do not appear. I'm sure it is probably something simple that I am missing, but I just can't figure it out. When I click the maximize button I get the buttons, but I can't figure out how to do it in code. Thanks, Mike
Try this:
void CChildFrame::ActivateFrame(int nCmdShow)
{
nCmdShow = SW_SHOWMAXIMIZED;
CMDIChildWnd::ActivateFrame(nCmdShow);
}ActivateFrame is a virtual function, you can use ClassWizard to quickly add declaration and default implementation. Tomasz Sowinski -- http://www.shooltz.com