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 » CExtReportGridWnd in Resizable dialog Collapse All
Subject Author Date
David Skok Oct 26, 2006 - 12:35 PM

I have a ReportGrid inside of a resizable formview which is displayed in a MDI frame wnd. Views of this sort are always maximized when instantiated. I set anchoring for the ReportGrid as follows:

AddAnchor( IDC_CUSTOM1, __RDA_LT, __RDA_LB );

If I resize the formview the ReportGrid resizes to the proper proportions however scrollbars in the ReportGrid never display when data is hidden in the now smaller ReportGrid.

What do I need to do to show scrollbars in the ReportGrid automatically when resizable Formview is resized?

Thanks

Technical Support Oct 27, 2006 - 6:13 AM

If you do not need the default scrolling feature of the CFormView class, just use a simple child dialog instead. If you need anchoring and scrolling at the same time depending on the view window’s size, you should not use the form view window either, because it is not compatible with anchoring.

You can download this project demonstrating how to create and use a scrollable container window compatible with anchoring. You could simply use a CExtScrollContainerWnd window as a child of the CView window. Or you could use the a CExtScrollContainerWnd window instead of any CView-based window if you don’t need the MFC’s document/view architecture.

Suhai Gyorgy Oct 27, 2006 - 1:28 AM

Catch the WM_SIZE message and update scrollbars in it:

void CChildView::OnSize(UINT nType, int cx, int cy)
{
	CFormView::OnSize(nType, cx, cy);
 
	m_reportGridWnd.OnSwUpdateScrollBars();
	m_reportGridWnd.OnSwDoRedraw();
}