15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


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




| Вернуться в корень Архива |