Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CPropertySheet minimum size

258 views
Skip to first unread message

Jake Montgomery

unread,
Jun 5, 2000, 3:00:00 AM6/5/00
to
Does anyone know how to get around the minimum width constraint for
PropertySheets.

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."

Jake Montgomery

unread,
Jun 5, 2000, 3:00:00 AM6/5/00
to
I believe you misunderstood my problem.

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


David Lowndes

unread,
Jun 5, 2000, 3:00:00 AM6/5/00
to
>Does anyone know how to get around the minimum width constraint for
>PropertySheets.

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.

George Lozovoi

unread,
Jun 5, 2000, 3:00:00 AM6/5/00
to

George Lozovoi

unread,
Jun 5, 2000, 3:00:00 AM6/5/00
to
In OnInitDialog()
1)close all buttons which you are need not
2) change the sizes and the positions you are need
3) change sizes of property sheet window itself
4) check that your sizes of the pages are not larger than property sheet
sizes


--
Best regards,
George


0 new messages