-Dale
--
Dale M. Nurden __|__ http://users.iafrica.com/d/da/dalen
dalen-rcis.co.za | Highway Radio, 101.5FM
dalen-iafrica.com | Christian Community Radio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author of TClockEx, the FREE taskbar clock enhancer.
Spam proofing in effect: Please use '@' in place of '-'.
Use a scrollbar control with the SBS_SIZEGRIP style. This
has the added feature of resizing the parent window (dialog
box, in your case) when clicked. This is the mechanism that
the resizable dialog boxes in Windows 98 (like the file
chooser) use. You will probably want to look at the docs
for more specific info about how to use it, but that's the
best accepted way to do it.
As a co-author of an interface customization program like
you mention, I'm very happy to see that's a consideration
for you. I wish more people were as careful.
Peter
Chris.
Dale M. Nurden <da...@not.my.real.email.address> wrote in message
news:38bc025d....@dbn-news.iafrica.com...
>What is the best way to draw a sizing grip into the lower right-hand
>corner of a dialog box?
[snip]
DrawFrameControl()?
ScottR
--
Scott Robins, Xerox Engineering Systems
Scott....@USA.Xerox.com, http://www.xes.com
>Use a scrollbar control with the SBS_SIZEGRIP style. This
>has the added feature of resizing the parent window (dialog
>box, in your case) when clicked. This is the mechanism that
>the resizable dialog boxes in Windows 98 (like the file
>chooser) use. You will probably want to look at the docs
>for more specific info about how to use it, but that's the
>best accepted way to do it.
Thanks, I will give that a try.
>As a co-author of an interface customization program like
>you mention, I'm very happy to see that's a consideration
>for you. I wish more people were as careful.
Doesn't everyone? ;-)
-Dale
Do it properly or don't do it at all.
Try adding the following to your dialog class:
// Message handler for WM_NCHITTEST
UINT CMyDialog::OnNcHitTest(CPoint point)
{
CRect rect;
GetSizeGripRect(&rect);
// The point to be tested is in screen coordinates
ClientToScreen(&rect);
// When in the size grip, pretend to be a portion of the sizing border
if (rect.PtInRect(point))
return HTBOTTOMRIGHT;
// Not in gripper portion -- pass along to parent class
return CDialog::OnNcHitTest(point);
}
// Message handler for WM_PAINT
void CMyDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect; // rectangle for drawing the size grip
GetSizeGripRect(&rect);
dc.DrawFrameControl(rect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
// Do not call CDialog::OnPaint() for painting messages
}
void CMyDialog::GetSizeGripRect(LPRECT lpRect)
{
GetClientRect(lpRect);
lpRect->left = lpRect->right - ::GetSystemMetrics(SM_CXHSCROLL);
lpRect->top = lpRect->bottom - ::GetSystemMetrics(SM_CYVSCROLL);
}
Hope this helps.
Sent via Deja.com http://www.deja.com/
Before you buy.