void CStrinkDlg::OnButton1()
{
CString str;
GetDlgItem(IDC_BUTTON1) ->GetWindowText(str);
if (str == "收缩<<")
{
GetDlgItem(IDC_BUTTON1) ->SetWindowText("扩展>>");
}
else
{
GetDlgItem(IDC_BUTTON1) ->SetWindowText("收缩<<");
}
static CRect rectLarge;
static CRect rectSmall;
if (rectLarge.IsRectNull())
{
CRect rectTemp;
GetWindowRect(&rectLarge);
GetDlgItem(IDC_STRINK) ->GetWindowRect(&rectTemp);
rectSmall.left = rectLarge.left;//左侧
rectSmall.top = rectLarge.top;//顶侧
rectSmall.right = rectLarge.right;//右侧
rectSmall.bottom = rectTemp.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);
}
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。