Solved

Resizing Controls in CFormView

Posted on 2001-07-10
5
450 Views
Last Modified: 2013-11-20
I have a CFormView derived view class that has some static rectangle controls in the dialog template.

I would like to resize the controls in my dialog template when the user resizes the application.  

I was thinking I would need to override CWnd::OnSize().  In my override, I would need to get the coordinates of my controls and recalculate new sizes and locations of them based on how big the client area is after the resize.  Is this the way to go?


Any help greatly appreciated!
0
Comment
Question by:klingej
[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
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
migel earned 50 total points
ID: 6271897
Hi!
you right it is proportional resizing method.
in general you have to done several steps:
1.store old size of the view
2.Catch OnSize message
3. calc proportional coefficiens : coeff = sizeNew/sizeoOld;
4.enumerate all child window in the form by GetWindow API
5. Resize all window according calculated coefficient
6.store new size as old (for next resizing).
0
 
LVL 12

Expert Comment

by:migel
ID: 6285133
Hi!
do you have additional Q?
It is very hard answer you without your response :-)
0
 

Author Comment

by:klingej
ID: 6286148
The general flow of your answer was right, but I ran into problems with one of the controls - an owner drawn CBitmapButton object.

However, I didn't have time to finish implementing this and finding the problem with the bitmap button.
0
 
LVL 12

Expert Comment

by:migel
ID: 6286169
In this case additional Q. will be preffered instead grading 'B'.
0
 

Author Comment

by:klingej
ID: 6286197
No time for additional questions...    plus I had to change a lot of the suggested solution to get it to work, thus the B grade.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 58
windows 10 how make picture as desktop background 2 71
has77  challenge 9 104
FizzBuzz challenge 9 87
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…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

737 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