Solved

Changing the size of a CMDIFrameWnd's border

Posted on 1997-03-01
1
364 Views
Last Modified: 2013-11-20
Is it possible to change the size of a CMDIFrameWnd's border?  I have an MDI app and I want to paint some controls in along the left side (vertically) of the frame window.  Thus moving it's client area over to the right more.  

I only want to change the left side of the border, the other side can stay the same.


0
Comment
Question by:tdietz
1 Comment
 
LVL 1

Accepted Solution

by:
serge010697 earned 25 total points
ID: 1300212
You may try something like that:

void CMainFrame::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
{
CMDIFrameWnd::OnNcCalcSize(bCalcValidRects, lpncsp);
if (bCalcValidRects)
          lpncsp->rgrc[0].left += 32;
}

Also you have to rewrite OnNcPaint:

void CMainFrame::OnNcPaint()
{
Default();
...Draw your stuff here
}
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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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