How to limit CWnd minimum size? RRS feed

  • Question

  • 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.
    Friday, August 1, 2008 5:16 AM


All replies