//收缩按钮的处理

void UserInterface::OnBnClickedBtnshrink()
{
// TODO: 在此添加控件通知处理程序代码
CString str;
        //if (GetDlgItem(IDC_BtnShrink)->GetWindowText(str),str=="收缩<<")
 

//{

 

// GetDlgItem(IDC_BtnShrink)->SetWindowText("扩展>>");

 

//} 

 

//else

 

//{

 

// GetDlgItem(IDC_BtnShrink)->SetWindowText("收缩<<");

 

//}

        //以下方法作用同上注释代码
if (GetDlgItemText(IDC_BtnShrink,str),str=="收缩<<")
{
SetDlgItemText(IDC_BtnShrink,"扩展>>");
else
{
SetDlgItemText(IDC_BtnShrink,"收缩<<");
}
 
static CRect rectLarge;
static CRect rectSmall;
if (rectLarge.IsRectNull())
{
CRect rectSeperator;
GetWindowRect(&rectLarge);//获取对话框原始尺寸
GetDlgItem(分隔符ID)->GetWindowRect(&rectSeperator);  //获取分隔符尺寸

//设置缩小后窗口的位置 top left right bottom
rectSmall.left=rectLarge.left;
rectSmall.top=rectLarge.top;
rectSmall.right=rectLarge.right;
rectSmall.bottom=rectSeperator.bottom;
}
if (str=="收缩<<")
{
SetWindowPos(NULL,0,0,rectSmall.Width(),rectSmall.Height(),SWP_NOZORDER|SWP_NOMOVE);
else
{
SetWindowPos(NULL,0,0,rectLarge.Width(),rectLarge.Height(),SWP_NOZORDER|SWP_NOMOVE);
}
}