为什么我做的可伸缩对话框缩小的时候就看不见了

解决方案 »

  1.   

    http://dev.csdn.net/author/starlee/8522073c8f034264a026dd78dbfa2feb.html参考一下.此例对话框内的控件不是按比例调整,如果需要看代码自己计算下就行了.
      

  2.   

    void CLoginDlg::OnSetting() 
    {
    // TODO: Add your control notification handler code here
    CString str;
    GetDlgItemText(IDC_SETTING,str);
    TRACE(str);
    if(str=="设置↑")//↓↑
    {
    SetDlgItemText(IDC_SETTING,"设置↓");
    }
    else
    {
    SetDlgItemText(IDC_SETTING,"设置↑");
    }
    if(rectLarge.IsRectNull())
    {
    CRect rectSeparator;
    GetWindowRect(&rectLarge);                                   //取得窗口的最大宽度跟高度 
        GetDlgItem(IDC_SEPARATOR)->GetWindowRect(&rectSeparator);    //取得分离线的位置
    rectSmall.left=rectLarge.left;
    rectSmall.top=rectLarge.top;
    rectSmall.right=rectLarge.right;
    rectSmall.bottom=rectSeparator.bottom;}
    if(str=="设置↑")
    {
    SetWindowPos(NULL,0,0,rectSmall.Width(),rectSmall.Height(),
    SWP_NOMOVE | SWP_NOZORDER);
    }
    else
    {
    SetWindowPos(NULL,0,0,rectLarge.Width(),rectLarge.Height(),
    SWP_NOMOVE | SWP_NOZORDER);
    }
    }
    我的代码,,,,缩小的时候是整个对话框消失