Solved

How to Maximize MDI Child View on startup?

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 126
How to determine file rename from EventLog ? 2 36
sumHeights2  challenge 7 76
Fibonacci challenge 11 82
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

707 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

19 Experts available now in Live!

Get 1:1 Help Now