Partilhar via


CSliderCtrl::Create

Creates a slider control and attaches it to a CSliderCtrl object.

virtual BOOL Create(
   DWORD dwStyle,
   const RECT& rect,
   CWnd* pParentWnd,
   UINT nID 
);

Parameters

  • dwStyle
    Specifies the slider control's style. Apply any combination of slider control styles, described in the Windows SDK, to the control.

  • rect
    Specifies the slider control's size and position. It can be either a CRect object or a RECT structure.

  • pParentWnd
    Specifies the slider control's parent window, usually a CDialog. It must not be NULL.

  • nID
    Specifies the slider control's ID.

Return Value

Nonzero if initialization was successful; otherwise 0.

Remarks

You construct a CSliderCtrl in two steps. First, call the constructor, and then call Create, which creates the slider control and attaches it to the CSliderCtrl object.

Depending on the values set for dwStyle, the slider control can have either a vertical or horizontal orientation. It can have tick marks on either side, both sides, or neither. It can also be used to specify a range of consecutive values.

To apply extended window styles to the slider control, call CreateEx instead of Create.

Requirements

Header: afxcmn.h

See Also

Reference

CSliderCtrl Class

Hierarchy Chart

CSliderCtrl::CSliderCtrl

Other Resources

CSliderCtrl Members