I have seen code which handles the drawing of this thing (DFCS_SCROLLSIZEGRIP), but surely there is a window style which I can apply to get it "for free". Right?
From stackoverflow
-
In lieu of a better answer, I will post the code I have that draws the size grip and handles the hit-testing. You also need to invalidate the appropriate area during OnSize in order to get it repainted.
BOOL CMyDialog::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; } }-
LRESULT CMyDialog::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); } -
I don't think there is a default style to get this functionality for free. You have to create a new child window with class name
Scrollbarand control style SBS_SIZEGRIP
0 comments:
Post a Comment