Link to home
Start Free TrialLog in
Avatar of Mindo
Mindo

asked on

Preventing the sizing of the CView derived class

I have a CView derived class and i want to restrict sizing of this window till some specific size.

I tried to do this in OnSize() and OnWindowPosChanged() events, but they didn't work.

Can anybody post a few lines of code how to do this?

Thanks.
Avatar of captainkirk
captainkirk

Is this an MDI or SDI app??

If you want the main frame to remain the same size, you can specify that it can't be resized by turning the WS_THICKFRAME style off in your main frame class' PreCreateWindow() function.
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You should respond to WM_GETMINMAXINFO.

and set the ptMinTrackSize and ptMaxTrackSize to the same value that
you want your view to be.

regards,
Mike.
woah - Zoppo's too quick :)