如何设定PropertySheet的宽度?
我在Dialog中贴了一个PropertySheet和几个PropertyPage,结果发现PropertySheet的宽度(实际上是窄度)到一定大小后就没法变小了(大约220Pixels)。找到MFC的源码照抄下来,虽然PropertySheet和PropertyPage都可变小了,但总有一片原先大小的东西漂浮在PropertyPage上方(是个与Dialog背景同色的东西,没有边框)。请问如何正确设定这个该死的窄度?
============
设定大小的Code.:
CRect rectOld;
::GetWindowRect(hWnd, &rectOld);
ScreenToClient(rectOld);
CRect rectNew(0, 0, 180, 32);
::MapDialogRect(m_hWnd, &rectNew);
if (rectNew.bottom < rectOld.bottom)
{
// move tab control
int cyDiff = rectOld.Height() - rectNew.bottom;
::SetWindowPos(hWnd, NULL, 0, 0, rectNew.right, rectNew.bottom,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
HDC hdc=::GetDC(hWnd);
::GetWindowRect(hWnd, rectNew);
::Rectangle( hdc, rectNew.left, rectNew.top, rectNew.right, rectNew.bottom);
// resize property sheet itself similarly
GetWindowRect(&rectOld);
SetWindowPos(NULL, 0, 0, rectNew.right+6, rectNew.bottom-20,
SWP_NOZORDER |SWP_NOMOVE | SWP_NOACTIVATE);
}