dev_yinz
asked on
How to Disable Resizing in SDI
1. I want to disable the resize function in the SDI program. It means user will not be able to resize the frame. How can I do that?
2. I want to resize the frame to certain size, so the view area has the same size as the Dialog I put in.
Example: A dialog is 320*240, I put this dialog into the view area. I need this area has the same size 320*240, and I don't want user to resize the frame.
2. I want to resize the frame to certain size, so the view area has the same size as the Dialog I put in.
Example: A dialog is 320*240, I put this dialog into the view area. I need this area has the same size 320*240, and I don't want user to resize the frame.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Handle 'WM_GETMINMAXINFO' by overriding 'OnGetMinMaxInfo()', e.g.
void CMyView::OnGetMinMaxInfo(MINMAXINFO* lpmmi)
{
lpmmi->ptMaxSize.x = 320;
lpmmi->ptMaxSize.y = 240;
lpmmi->ptMaxTrackSize.x = 320;
lpmmi->ptMaxTrackSize.y = 240;
lpmmi->ptMinTrackSize.x = 240;
lpmmi->ptMinTrackSize.y = 240;
}
CFormView acts like a normal view (can fits the client area of the main frame) but are designed to contains standard controls like a dialog.