Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote a MDI application with document-template technique. One of my form must be created in 'fixed size' (my view class is derived from CFormView), how can I force my view create in fix size & no respectable?
thank you...
Posted
Updated 20-Jun-10 7:26am
v2
Comments
[no name] 20-Jun-10 6:02am    
You would better try to clarify your question.What exactly you are trying to do?You want non-resizable MDI child frame or what...
mohammadmot 20-Jun-10 7:41am    
yes, i means: non-resizable MDI child frame (one of my child isn't resizable)

A fixed-size child form in a MDI application doesn't make any sense, especially when you consider the Tile/Cascade or minimize/normalize/maximize abilites of a MDI child form.

You should be considering the use of a modeless dialog box instead. At that point, you can make the dialog box not re-sizable by simple property settings.

If you insist on not adhering to the standard MDI-child functionality, you may be able to simply handle the various organizing events and omit that window from the natural order of things. Personally, I think that's a bad idea.
 
Share this answer
 
v3
Hi, :-O
I found my answer and test code, it's correct,
// ====================================
// Size & Fix Mode
// my child frame class is:
class CDBChild : public CMDIChildWnd

// in my form view class:
class CDBView : public CFormView

// in function:
void CDBView::OnInitialUpdate()

// with this code:
RECT sz_window,sz_panel;
GetDlgItem(IDC_STATIC_DB_PANEL)->GetWindowRect(&sz_panel);
GetParent()->ModifyStyle(WS_OVERLAPPEDWINDOW ,WS_BORDER |WS_CAPTION |WS_SYSMENU |WS_MINIMIZEBOX);

CDBChild* pChild = ((CDBChild*)GetParent());
ScreenToClient((LPRECT)&sz_panel);
// sz_window = ((CDBChild*)GetParent())->m_Rect;
const int nHashie = 9;
sz_window = sz_panel;
sz_window.bottom += (2*nHashie + 2*8 + 1*28);// sz_panel.bottom - sz_panel.top + 10;
sz_window.right += (2*nHashie + 2*8);// = sz_panel.right - sz_panel.left + 10;

GetParent()->MoveWindow(&sz_window);
((CDBChild*)GetParent())->ShowWindow(SW_RESTORE);
((CDBChild*)GetParent())->BringWindowToTop();


// make new window have fix size & not resizable.
// ====================================
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900