MDI中的VIEW的OnSize事件应怎么写,清mfc高手帮我。
deyi 2003-12-12 02:25:11 void CListVew::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
CWnd * pWnd ;
// TODO: Add your message handler code here
if(this!=NULL)
{
pWnd = (CWnd*) this->GetDlgItem(IDC_MODUELLIST) ;
if(pWnd->GetSafeHwnd())
{
m_ModuleName.MoveWindow(5,5,cx,cy);
m_ModuleList.MoveWindow (5, 30 , cx-5, cy -30) ;
}
}
}
我写的代码如下。但是老报错。
原因在pWnd->GetSafeHwnd()有效时,
m_ModuleName.MoveWindow(5,5,cx,cy); (CSTATIC)
m_ModuleList.MoveWindow (5, 30 , cx-5, cy -30) ;(CLISTBOX)
无效。这个时键怎么写不会出现这种情况。