Solved

Resizing Controls in CFormView

Posted on 2001-07-10
5
428 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

16 Experts available now in Live!

Get 1:1 Help Now