Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to Maximize MDI Child View on startup?

Posted on 1997-04-27
2
Medium Priority
?
507 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 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

721 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