Solved

How to Maximize MDI Child View on startup?

Posted on 1997-04-27
2
500 Views
Last Modified: 2013-11-20
I have an MDI app and I would like to know how to display the initial CView  in a maximized state on startup or on opening a new vew.  I have tried Wingo's tip in his FAQ but this did not seem to help.  I know how to maximize the CFrameWnd but how do I maximize the MDI child views?
0
Comment
Question by:duhrbroc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
xbwen earned 50 total points
ID: 1301206
  Add MDIMaximize() in your CChildFrame::OnCreate() such as:  

 int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 {
      if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
            return -1;
      
      // TODO: Add your specialized creation code here
      this->MDIMaximize();

      return 0;
 }

0
 

Author Comment

by:duhrbroc
ID: 1301207
Dear xbwen:

Thanks for your info.  As implemented, your code caused an assertion.  Below is a method that works.  Thanks very much.  Your solution is elegant and simple.  Well done.

BOOL CChildFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CMDIFrameWnd* pParentWnd, CCreateContext* pContext)
{
      // TODO: Add your specialized code here and/or call the base class
      BOOL      bRetval;
      bRetval = CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext);
      this->MDIMaximize();
      return bRetval;
}

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question