I only have 'Ok' and 'Cancel', and screen real estate is critical for my
modeless property sheet.
From moicrosoft.com: "The minimum width of a CPropertySheet window is
the size of the four buttons (OK, Cancel, Apply, and Help) that would
show up along the bottom of a modal property sheet. This width applies
even to modeless property sheets, which do not show the four buttons
along the bottom."
MFC will not let me set the size of a CPropertySheet below the 'minimum' width -
I can call SetWindiowPos all I like and it works fine, as long as the width is
above that minimum size. Trying to set a smaller width does not work.
Jake.
George Lozovoi wrote:
> Hi Jake,
>
> Using SendDlgItemMessage(), SetWindowPos() and like functions you can change
> set of buttons and its attributes and sizes of property sheets.
>
> --
> Best regards,
> George
Jake,
There is a minimum size, but you can resize it in the OnInitDialog
routine of your property sheet class. Here's an example to illustrate
how to resize the tab control of the property sheet:
BOOL CXPropSheet::OnInitDialog()
{
HWND hWnd = (HWND)::GetDlgItem(m_hWnd, AFX_IDC_TAB_CONTROL);
CRect rectOld;
::GetWindowRect(hWnd, &rectOld);
ScreenToClient(rectOld);
int nCy = rectOld.Width()/2;
rectOld.right -= nCy;
// move tab control
::SetWindowPos(hWnd, NULL, 0, 0, rectOld.Width(),
rectOld.Height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
GetWindowRect(&rectOld);
rectOld.right -= nCy;
SetWindowPos(NULL, 0, 0, rectOld.Width(), rectOld.Height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
return CPropertySheet::OnInitDialog();
}
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.
--
Best regards,
George