Link to home
Start Free TrialLog in
Avatar of dev_yinz
dev_yinzFlag for Singapore

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.
ASKER CERTIFIED SOLUTION
Avatar of alb66
alb66
Flag of Italy 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
Also consider an MDI scenario using CFormView instead of CDialog.
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.
Avatar of jkr
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;
}

Open in new window