void CHWParkDlg::OnSizing(UINT fwSide,LPRECT pRect)
{
    CDialog::OnSizing(fwSide,   pRect);   
    //   TODO:   Add   your   message   handler   code   here  
    CRect   rect(pRect);  
    int   width=rect.Width();  
    int   height=rect.Height();  
    switch(fwSide)  
    {  
    case   WMSZ_BOTTOM:  
        {  
            if(height<MINDLG_HEIGHT)  
                pRect->bottom=pRect->top+MINDLG_HEIGHT;  
            break;  
        }  
    case   WMSZ_LEFT:  
        {  
            if(width<MINDLG_WIDTH)  
                pRect->left=pRect->right-MINDLG_WIDTH;  
            break;  
        }  
    case   WMSZ_RIGHT:  
        {  
            if(width<MINDLG_WIDTH)  
                pRect->right=pRect->left+MINDLG_WIDTH;  
            break;  
        }  
    case   WMSZ_TOP:  
        {  
            if(height<MINDLG_HEIGHT)  
                pRect->top=pRect->bottom-MINDLG_HEIGHT;  
            break;  
        }  
    case   WMSZ_TOPLEFT:  
        {  
            if(width<MINDLG_WIDTH)  
                pRect->left=pRect->right-MINDLG_WIDTH;  
            if(height<MINDLG_HEIGHT)  
                pRect->top=pRect->bottom-MINDLG_HEIGHT;  
            break;  
        }  
    case   WMSZ_TOPRIGHT:  
        {  
            if(width<MINDLG_WIDTH)  
                pRect->right=pRect->left+MINDLG_WIDTH;  
            if(height<MINDLG_HEIGHT)  
                pRect->top=pRect->bottom-MINDLG_HEIGHT;  
            break;  
        }  
    case   WMSZ_BOTTOMLEFT:
        {  
            if(width<MINDLG_WIDTH)
                pRect->left=pRect->right-MINDLG_WIDTH;  
            if(height<MINDLG_HEIGHT)  
                pRect->bottom=pRect->top+MINDLG_HEIGHT;  
            break;  
        }  
    case   WMSZ_BOTTOMRIGHT:
        {  
            if(width<MINDLG_WIDTH)  
                pRect->right=pRect->left+MINDLG_WIDTH;  
            if(height<MINDLG_HEIGHT)  
                pRect->bottom=pRect->top+MINDLG_HEIGHT;  
            break;
        }  
    }  
}

相关文章:

  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2021-12-11
  • 2021-10-09
  • 2021-11-18
  • 2021-12-27
相关资源
相似解决方案