Resizing an OLE control
Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Monday, December 16, 1996
void CMyFormView::OnInitialUpdate(){
CFormView::OnInitialUpdate();
GetParentFrame->RecalcLayout();
ResizeParentToFit(FALSE);
ResizeParentToFit(TRUE);
}
mcontest@universal.com
=====Snip->Start() ==========
I have a tiny problem with my MDI application. At startup I can't get my OLE
control (derived from CWnd) fitting my CFormView (parent of the control)
client area.
Here is the OnSize overridden of my CFormView class:
void CMyFormView::OnSize(UINT nType, int cx, int cy)
{
CMyFormView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect size;
GetClientRect(&size);
if(IsWindow(m_grid.m_hWnd)) m_grid.MoveWindow(&size);//m_grid is my OLE control
}
J Ride up Okajima -- j-okajim@nmite92.nmit.mt.nec.co.jp
Wednesday, December 18, 1996
Syed:
> >I have a tiny problem with my MDI application. At startup I can't get my OLE
> >control (derived from CWnd) fitting my CFormView (parent of the control)
> >client area.
> >Here is the OnSize overridden of my CFormView class:
As you want to resize ole control on CView, CView::OnInitialUpdate is
better than CView::OnSize.
I suppose the code you wrote at OnSize will work well at OnInitialUpdate.
regards
Junjiro Okajima
| Вернуться в корень Архива
|