Re: How to limit CWnd minimum size?



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@xxxxxxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Resizing a CEdit control to fill its parent DialogBox???
    ... You might want to take some time to browse my "Dialog Box Series" on my MVP Tips site. ... Use ClassWizard to create control variables. ... int Height = rect.bottom - rect.top; ...
    (microsoft.public.vc.mfc)
  • Re: afx_msg (VC++ 6->VS 2005)
    ... void XXXX. ... programmers didn't have to keep typing 'int'. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: min / max
    ... something else, you have to add an overload for that, and... ... int max ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: returning two values
    ... Joe. ... > int a; ... > Indices ComputeIndices() ... > MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Are static array pointers thread safe?
    ... implementation, using the value a twice, once as the array name, once as a parameter) ... pointers thread safe /NT". ... checked by the read-write functions using an enum or static const int ... MVP Tips:http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)