Solved

How to Maximize MDI Child View on startup?

Posted on 1997-04-27
2
490 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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 …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now