在CFormView派生的CXXView里,响应WM_SIZE,代码如下void CEDView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect clientRect;
GetClientRect(&clientRect);
int iBound = clientRect.right*2/3;//客户区的左边的三分之二作为规格编辑区 CRect specRect;
specRect.bottom = clientRect.bottom - 10;
specRect.top = clientRect.top + 10;
specRect.left = clientRect.left + 10;
specRect.right = iBound - 10;
GetDlgItem(IDC_SPECLIST)->MoveWindow(clientRect.top,clientRect.left,
clientRect.right-clientRect.left,clientRect.bottom-clientRect.top,true);
}IDC_SPECLIST是一个标识框的ID,,试过换成CListCtrl的ID也不行,调试时跟进去是CWnd::MoveWindow里的ASSERT(::IsWindow(m_hWnd))出现断言啦,怎么解决?谢谢各位大侠...
急,在线等,,,,
{
CFormView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect clientRect;
GetClientRect(&clientRect);
int iBound = clientRect.right*2/3;//客户区的左边的三分之二作为规格编辑区 CRect specRect;
specRect.bottom = clientRect.bottom - 10;
specRect.top = clientRect.top + 10;
specRect.left = clientRect.left + 10;
specRect.right = iBound - 10;
GetDlgItem(IDC_SPECLIST)->MoveWindow(clientRect.top,clientRect.left,
clientRect.right-clientRect.left,clientRect.bottom-clientRect.top,true);
}IDC_SPECLIST是一个标识框的ID,,试过换成CListCtrl的ID也不行,调试时跟进去是CWnd::MoveWindow里的ASSERT(::IsWindow(m_hWnd))出现断言啦,怎么解决?谢谢各位大侠...
急,在线等,,,,
if(GetDlgItem(IDC_SPECLIST)->GetSafeHwnd())
GetDlgItem(IDC_SPECLIST)->MoveWindow(clientRect.top,clientRect.left,
clientRect.right-clientRect.left,clientRect.bottom-clientRect.top,true);