Solved

Resizing Controls in CFormView

Posted on 2001-07-10
5
416 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
Comment Utility
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
Comment Utility
Hi!
do you have additional Q?
It is very hard answer you without your response :-)
0
 

Author Comment

by:klingej
Comment Utility
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
Comment Utility
In this case additional Q. will be preffered instead grading 'B'.
0
 

Author Comment

by:klingej
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

13 Experts available now in Live!

Get 1:1 Help Now