虽不太难 还是写来以后会方便不少
IDC_S是一个 图像 控件 用于指明分割窗口的位置
voidCZzDlg::OnOK()
...{
CStringstr;
GetDlgItemText(IDOK,str);
if(str=="收")
...{
SetDlgItemText(IDOK,"放");
}else
...{
SetDlgItemText(IDOK,"收");
}
staticCRectrectLarge;
staticCRectrectSmall;
if(rectLarge.IsRectNull())
...{
GetWindowRect(&rectLarge);
CRectrectSeparator;
GetDlgItem(IDC_S)->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);
}
}
参考文献:VC++编程详解 作者:孙鑫
3294

被折叠的 条评论
为什么被折叠?



