本帖最后由 VisualEleven 于 2014-11-04 18:08:00 编辑

解决方案 »

  1.   

    给 子对话框 发 WM_SIZE 消息
      

  2.   

    最终要调用的是对话框对象的MoveWindow
      

  3.   

    void CTabDlgDlg::OnSize(UINT nType, int cx, int cy) 
    {
    CDialog::OnSize(nType, cx, cy);
    // TODO: Add your message handler code here
    int now;
    if(m_Tab.m_hWnd)
    {//
    m_Tab.SendMessage(WM_SIZE,(WPARAM)nType,MAKELONG(cx, cy));
    now=m_Tab.GetCurSel();
    if(now==-1) return;
    }
    //
    switch(now)
    {
    case 0:
    if(m_Dlg1.m_hWnd)
    m_Dlg1.SendMessage(WM_SIZE,(WPARAM)nType,MAKELONG(cx,cy));
    break;
    case 1:
    if(m_Dlg2.m_hWnd)
    m_Dlg2.SendMessage(WM_SIZE,(WPARAM)nType,MAKELONG(cx,cy));
    break;
    ......void CMyTab::OnSize(UINT nType, int cx, int cy) 
    {
    CTabCtrl::OnSize(nType, cx, cy);

    // TODO: Add your message handler code here
    CRect rc;
    GetWindowRect(&rc);
    ScreenToClient(&rc);
    rc.right+=cx;
    rc.bottom+=cy;
    MoveWindow(&rc);
    }