Re: size grip in dialog boxes
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Tue, 17 Jan 2006 20:20:08 -0800
// WM_ERASEBKGND
BOOL CMyDlg::OnEraseBkgnd(CDC* pDC)
{
if (CDialog::OnEraseBkgnd(pDC))
{
// draw size grip
CRect r;
GetClientRect( & r);
int size = GetSystemMetrics(SM_CXVSCROLL);
r.left = r.right - size;
r.top = r.bottom - size;
pDC->DrawFrameControl( & r, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
return TRUE;
}
else
{
return FALSE;
}
}
// WM_NCHITTEST
UINT CMyDlg::OnNcHitTest(CPoint point)
{
// return HTBOTTOMRIGHT for sizegrip area
CRect r;
GetClientRect( & r);
int size = GetSystemMetrics(SM_CXVSCROLL);
r.left = r.right - size;
r.top = r.bottom - size;
ScreenToClient( & point);
if (r.PtInRect(point))
{
return HTBOTTOMRIGHT;
}
else
return CDialog::OnNcHitTest(point);
}
// WM_SIZING
void CMyDlg::OnSizing(UINT fwSide, LPRECT pRect)
{
CDialog::OnSizing(fwSide, pRect);
// invalidate an area currently (before resizing) occupied
// by size grip
CRect r;
GetClientRect( & r);
int size = GetSystemMetrics(SM_CXVSCROLL);
r.left = r.right - size;
r.top = r.bottom - size;
InvalidateRect( & r, FALSE); // do not erase background now
// invalidate an area which will be (after resizing)
// occupied by size grip
r = * pRect;
r.left = r.right - size;
r.top = r.bottom - size;
InvalidateRect( & r, FALSE);
}
"srinivas vaithianathan" <srinivasvaithianathan@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote in message news:DE74D7A1-8C86-4E0E-9B9A-29B90191A4FB@xxxxxxxxxxxxxxxx
>I would like to show a size grip in a dialog box. (a small bitmap at the
> right corner of dialog box to help in resizing). I think this is a
> standard
> feature of Windows XP visual styles. I created a dialog box with
> WS_THICKFRAME style and I have manifest file to get 6.0 common ctrls. But
> I
> do not see any size grip in the right corner even though the frame of the
> dialog box allows resizing.
.
- Follow-Ups:
- Re: size grip in dialog boxes
- From: srinivas vaithianathan
- Re: size grip in dialog boxes
- Prev by Date: Re: size grip in dialog boxes
- Next by Date: Re: How do I change the color of a button in a dialog?
- Previous by thread: Re: size grip in dialog boxes
- Next by thread: Re: size grip in dialog boxes
- Index(es):
Relevant Pages
|