How to get the width and height of the Form Template
-
Hallo, I use a tabbed Dialog, which shows several Dialogs in it. The tabbed Dialog is resized to the size of its MDI Window. The problem is, that if the MDI Window is resized to a smaller size then the dialog in the tabbed control, the dialog in the tabbed control is not shown completely. So I want to know not the window rect of the dialog in the tabbed dialog, but the size of my form template, which I designed in the form editor of Visual C++ 6 So my main question is: Is it possible to get the height and with of my form as it is in the editor, so to speak the size of my, for example, IDD_MAIN_DIALOG resource my CDialog derived class? Thank you for your help!
-
Hallo, I use a tabbed Dialog, which shows several Dialogs in it. The tabbed Dialog is resized to the size of its MDI Window. The problem is, that if the MDI Window is resized to a smaller size then the dialog in the tabbed control, the dialog in the tabbed control is not shown completely. So I want to know not the window rect of the dialog in the tabbed dialog, but the size of my form template, which I designed in the form editor of Visual C++ 6 So my main question is: Is it possible to get the height and with of my form as it is in the editor, so to speak the size of my, for example, IDD_MAIN_DIALOG resource my CDialog derived class? Thank you for your help!
use GetWindowRect() function to get rectangle for the dialog box and then a simple math will solve your problem
-
use GetWindowRect() function to get rectangle for the dialog box and then a simple math will solve your problem
But the Problem is, that I get the current size of my form with GetWindowRect(). If it has already been scaled to small, some of the form controls will not be shown...I need the height and width of my Form as I see it in the form Editor...
-
But the Problem is, that I get the current size of my form with GetWindowRect(). If it has already been scaled to small, some of the form controls will not be shown...I need the height and width of my Form as I see it in the form Editor...
One way I could think is store your original dialog rectangle in some variable and use those values in InitDialog() Function. The other dirty way, you can check the the dialog box co-ordinates in .rc file. and set the Dialogbox rectangle to those value in InitDilaog fuction(). HTH
-
One way I could think is store your original dialog rectangle in some variable and use those values in InitDialog() Function. The other dirty way, you can check the the dialog box co-ordinates in .rc file. and set the Dialogbox rectangle to those value in InitDilaog fuction(). HTH
The dialog units are not in pixels though - see the GetDialogBaseUnits()[^] function for details.