dialog box resizing

dialog box resizing

Post by Martin Grot » Sat, 28 Feb 1998 04:00:00



Hello,

for a dialog-based application, i want to install a ">>" button which will resize the window and display more controls.
The upper-left area displaying two values in a border should remain as it is. Of course i could design another dialog
and switch between them, but then i've got the problem to keep them consistent etc. So i'd prefer to size the window so
that normally, only the upper left area is visible, and simply resize it when the user clicks the button.

But, a dialog is laid out differently depending on the system font size! So i can't use constants for the resize
function. Is there a way to calculate the two required sizes, or a better way to handle it?

Thanks!

Martin Grote

--


-- Raymond Chandler: The long goodbye -- one of my favourite books --

 
 
 

dialog box resizing

Post by Raymond Ch » Sat, 28 Feb 1998 04:00:00


Create a hidden control whose size is equal to the "expanded
size".  Use GetDlgItem() and GetWindowRect() to determine its
size and position.  Use these values as the parameters for
MoveWindow.
--
(My return address is intentionally invalid to foil spammers.  Delete the
".---" to get my real address.  I do this on my own time with my own money;
my responses are not to be considered official technical support or advice.)

 
 
 

dialog box resizing

Post by C.A. » Sat, 28 Feb 1998 04:00:00


[...]

Quote:>But, a dialog is laid out differently depending on the system font size!
>So i can't use constants for the resize function. Is there a way to
>calculate the two required sizes, or a better way to handle it?

Take a look at GetDialogBaseUnits()

Ciao,
Claus