Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Resize CFormView in CExtControlBar Collapse All
Subject Author Date
Eric CASADOUMECQ Oct 10, 2007 - 1:53 AM

Hi,

In an MDI project based on the document/view architecture, I have a child view class derived from CExtWA < CExtWS < CExtAFV < CFormView> > > class in a CExtControlBar.
I would like having my FormView stretch dynamically to entire client area of the CExtControlBar window.
I have tried this code but with no effect:

void CMyExtControlBar::OnSize(UINT nType, int cx, int cy)
{
    CExtControlBar::OnSize(nType,cx,cy);
    if(m_pView)
    {
        CRect rect;
        GetClientRect(&rect);
        m_pView->MoveWindow(rect);        

    
    }
}

Have you got an idea?

Suhai Gyorgy Oct 10, 2007 - 3:18 AM

CExtControlBar automatically resizes its single child window to fit, you don’t have to add any code to implement this. What makes you think that the formview is not resized?

Have you set anchors for its controls in its OnInitialUpdate? If so, please read this FAQ: How to apply anchoring for controls when using CFormView?

FormViews, similarly to dialogs, have a minimum size which is the size set in their resource. If you try to make the formview smaller than that size, scrollbars should appear.