Minimum CDialog size
-
I've got a modeless dialog box which can be resized and I would like to set a minumum size for it, as it looks stupid if it is too small. Any ideas? I tried editing the OnSize function like this (thinking that if it worked I could check for 'cx < MINIMUM_X' and change cx if required):- void CDlg::OnSize(UINT nType, int cx, int cy) { cx = 200; cy = 300; CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here } It didn't work, the dialog stayed the same size. And when I looked at cx and cy in the debugger their values did not change (they were 605 & 573 when it entered the function and the same when CDialog::OnSize was called). I am very confused about why they did not change :confused:. Can anyone help? Any comments welcome :). ali p
-
I've got a modeless dialog box which can be resized and I would like to set a minumum size for it, as it looks stupid if it is too small. Any ideas? I tried editing the OnSize function like this (thinking that if it worked I could check for 'cx < MINIMUM_X' and change cx if required):- void CDlg::OnSize(UINT nType, int cx, int cy) { cx = 200; cy = 300; CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here } It didn't work, the dialog stayed the same size. And when I looked at cx and cy in the debugger their values did not change (they were 605 & 573 when it entered the function and the same when CDialog::OnSize was called). I am very confused about why they did not change :confused:. Can anyone help? Any comments welcome :). ali p
-
Thanks you for your reply. I added a message handler for WM_GETMINMAXINFO to CMainFrame and that worked fine :) . BUT i wanted to set the minimum size for a Dialog box and when I go to add a 'New Windows Mesage Event' for for the dialog box, WM_GETMINMAXINFO is not on the list :( . Any ideas? ali p
-
Thanks you for your reply. I added a message handler for WM_GETMINMAXINFO to CMainFrame and that worked fine :) . BUT i wanted to set the minimum size for a Dialog box and when I go to add a 'New Windows Mesage Event' for for the dialog box, WM_GETMINMAXINFO is not on the list :( . Any ideas? ali p
Yeah, that's a design flaw in VC++. You have to go to the last page of the class wizard - can't remember what it's called, alas, I've moved to VC7 and ClassWizard is gone - and then there's a silly little combo box labeled "class type" or something like that. Change it from "dialog" to "window" and all of the messages will be availale.
-
Yeah, that's a design flaw in VC++. You have to go to the last page of the class wizard - can't remember what it's called, alas, I've moved to VC7 and ClassWizard is gone - and then there's a silly little combo box labeled "class type" or something like that. Change it from "dialog" to "window" and all of the messages will be availale.
Jim A. Johnson wrote: I've moved to VC7 and ClassWizard is gone Ya, I looked for ever to find where to enter in OnPaint() handler for My dialog class. I would have added a menu for a Message handler dialog box when you right click the Class in the solution explorer like VC++6.0 had like the Project(I can't rememeber what the tab name is) window. Real World Coding: POP& BuyAPop(Money ADollar){...};