Link to home
Start Free TrialLog in
Avatar of jaredg27
jaredg27

asked on

Dyamically determining the pixel size of a CFormView resource

I have a great many "dialogs" of type FormView that I created in the resource editor.  These dialogs eventually get linked to a frame within a CMultiDocTemplate and then are displayed on the screen.  Considering the detail of these forms, I would like them to come up as a specific size and be resizable within certain limits.  I have already figured out how to give it a starting pixel size and constrain it to certain pixel limits (thank you to any who may have helped me).  My problem is that the resources' pixel sizes, which are easily determinable on my machine, are actually different on other people's machines (making the frame appear too big or too small for the view).  Consequently I would like to dynamically figure out the size of these CFormView resources.
Avatar of chensu
chensu
Flag of Canada image

HOWTO: Translate Dialog-Box Size Units to Screen Units
http://support.microsoft.com/support/kb/articles/q74/2/80.asp

HOWTO: Calculate Dialog Base Units with Non-System-Based Font
http://support.microsoft.com/support/kb/articles/q125/6/81.asp

HOWTO: Calculate Dialog Units When Not Using the System Font
http://support.microsoft.com/support/kb/articles/q145/9/94.asp
Avatar of jaredg27
jaredg27

ASKER

the dialog based units to screen units information would have been great stuff, but it only works with CDialogs and I am using CFormView objects.  The other two sites applied more to screen drawing commands and calculations of font sizes than to dynamically determining the size of my form(considering I knew nothing about the fonts within the form).  Thank you for the help though.
I solved the problem with CScrollView's GetTotalSize():
CSize formViewSize = GetTotalSize();
******************------------------****************
But I have a new question along the same topic:

How does one dynamically figure out the distance from a control to a dialog edge.  I haven't even investigated it enough yet, but I'm gonna dive in now...
The inside client edge or the outside window edge?
ASKER CERTIFIED SOLUTION
Avatar of cpopin
cpopin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The answer I just gave is for the inside client edge (thought that would be most useful to you).
i already solved this question (as i noted in my notes), but i have to give up the points anyways