程序如下:
其中COleDBRecordView是视图类,m_dataAdo1是MS ADC控件的一个变量、m_dataGrid1为MS DataGrid控件的一个变量。void CADO2View::OnSize(UINT nType, int cx, int cy) 
{
COleDBRecordView::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
int iHeight, iWidth;        // Control heightandwidth.        
CRect rect;           // Control size.
COleDBRecordView::OnSize(nType,cx,cy);
m_dataAdo1.GetClientRect(rect);
iHeight = rect.Height();
iWidth = rect.Width();
m_dataAdo1.MoveWindow(cx, cy, iWidth, iHeight, TRUE);
         m_dataGrid1.MoveWindow(0, 0, cx, cy - iHeight, TRUE);}不知是何原因,请指教!