Udostępnij za pośrednictwem


CDC::DrawFrameControl

Call this member function to draw a frame control of the specified type and style.

BOOL DrawFrameControl(
   LPRECT lpRect,
   UINT nType,
   UINT nState 
);

Parameters

  • lpRect
    A pointer to a RECT structure that contains the logical coordinates of the rectangle.

  • nType
    Specifies the type of frame control to draw. See the uType parameter in DrawFrameControl in the Windows SDK for a list of this parameter's possible values.

  • nState
    Specifies the initial state of the frame control. Can be one or more of the values described for the uState parameter in DrawFrameControl in the Windows SDK. Use the nState value DFCS_ADJUSTRECT to adjust the bounding rectangle to exclude the surrounding edge of the push button.

Return Value

Nonzero if successful; otherwise 0.

Remarks

In several cases, nState depends on the nType parameter. The following list shows the relationship between the four nType values and nState:

  • DFC_BUTTON

    • DFCS_BUTTON3STATE   Three-state button

    • DFCS_BUTTONCHECK   Check box

    • DFCS_BUTTONPUSH   Push button

    • DFCS_BUTTONRADIO   Radio button

    • DFCS_BUTTONRADIOIMAGE   Image for radio button (nonsquare needs image)

    • DFCS_BUTTONRADIOMASK   Mask for radio button (nonsquare needs mask)

  • DFC_CAPTION

    • DFCS_CAPTIONCLOSE   Close button

    • DFCS_CAPTIONHELP   Help button

    • DFCS_CAPTIONMAX   Maximize button

    • DFCS_CAPTIONMIN   Minimize button

    • DFCS_CAPTIONRESTORE   Restore button

  • DFC_MENU

    • DFCS_MENUARROW   Submenu arrow

    • DFCS_MENUBULLET   Bullet

    • DFCS_MENUCHECK   Check mark

  • DFC_SCROLL

    • DFCS_SCROLLCOMBOBOX   Combo box scroll bar

    • DFCS_SCROLLDOWN   Down arrow of scroll bar

    • DFCS_SCROLLLEFT   Left arrow of scroll bar

    • DFCS_SCROLLRIGHT   Right arrow of scroll bar

    • DFCS_SCROLLSIZEGRIP   Size grip in bottom-right corner of window

    • DFCS_SCROLLUP   Up arrow of scroll bar

Example

This code draws the size gripper in the bottom-right corner of your window. It's appropriate for the OnPaint handler of a dialog box, which has no styles and normally doesn't contain other controls (like a status bar) that may give it a size gripper.

void CDCView::DrawFC(CDC* pDC)
{
   CRect rc;
   GetClientRect(&rc);

   rc.left = rc.right - ::GetSystemMetrics(SM_CXHSCROLL);
   rc.top = rc.bottom - ::GetSystemMetrics(SM_CYVSCROLL);

   pDC->DrawFrameControl(rc, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
}

Requirements

Header: afxwin.h

See Also

Reference

CDC Class

Hierarchy Chart

DrawFrameControl

Other Resources

CDC Members