From: Landon on
I use MFC Visual C++ 4.2.

I make a resizable Window. But I want to limit the minimum width and height
of the Window so that all the contents still displayed.

I have tried:

void CToiawaseDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);

// TODO: この位置にメッセージ ハンドラ用のコードを追加してください
if( cx < MIN_MAINWND_WIDTH )
cx = MIN_MAINWND_WIDTH;
if( cy < MIN_MAINWND_HEIGHT )
cy = MIN_MAINWND_HEIGHT;

}

but it did not work, it still too small if I tried to resize it.

How to solve this?

Thank you.
From: David Ching on
"Landon" <Landon(a)discussions.microsoft.com> wrote in message
news:48A9AC6F-2F80-4412-A02D-5701792D6F9D(a)microsoft.com...
> I make a resizable Window. But I want to limit the minimum width and
> height
> of the Window so that all the contents still displayed.
>

Override WM_GETMINMAXINFO (OnGetMinMaxInfo).

-- David


From: Joseph M. Newcomer on
Take a look at my essay on limiting dialog box size on my MVP Tips site:

http://www.flounder.com/getminmaxinfo.htm
joe

On Thu, 31 Jul 2008 22:16:01 -0700, Landon <Landon(a)discussions.microsoft.com> wrote:

>I use MFC Visual C++ 4.2.
>
>I make a resizable Window. But I want to limit the minimum width and height
>of the Window so that all the contents still displayed.
>
>I have tried:
>
>void CToiawaseDlg::OnSize(UINT nType, int cx, int cy)
>{
> CDialog::OnSize(nType, cx, cy);
>
> // TODO: ?????????? ??????????????????
> if( cx < MIN_MAINWND_WIDTH )
> cx = MIN_MAINWND_WIDTH;
> if( cy < MIN_MAINWND_HEIGHT )
> cy = MIN_MAINWND_HEIGHT;
>
>}
>
>but it did not work, it still too small if I tried to resize it.
>
>How to solve this?
>
>Thank you.
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm