CSliderCtrl::Create
BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );
Return Value
Nonzero if initialization was successful; otherwise 0.
Parameters
dwStyle
Specifies the slider control’s style. Apply any combination of slider control styles 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.
Remarks
You construct a CSliderCtrl in two steps. First call the constructor, then call Create, which creates the slider control and attaches it to the CSliderCtrl object.
Slider controls can have either a vertical or horizontal orientation. They can have tick marks on either side, both sides, or neither. They can also be used to specify a range of consecutive values. These properties are controlled by using slider styles, which you specify when you create the slider control:
-
TBS_HORZ Orients the slider horizontally. This is the default orientation.
-
TBS_VERT Orients the slider vertically. If you do not specify an orientation, the slider is oriented horizontally.
-
TBS_AUTOTICKS Creates a slider that has a tick mark for each increment in its range of values. These tick marks are added automatically when an application calls the SetRange member function. You cannot use the SetTic and SetTicFreq member functions to specify the position of the tick marks if you use this style. Use the ClearTics member function instead.
-
TBS_NOTICKS Creates a slider that does not display tick marks.
-
TBS_BOTTOM Displays tick marks on the bottom of a horizontal slider. Can be used with the TBS_TOP style to display tick marks on both sides of the slider control.
-
TBS_TOP Displays tick marks on the top of a horizontal slider. Can be used with the TBS_BOTTOM style to display tick marks on both sides of the slider control.
-
TBS_RIGHT Displays tick marks on the right of a vertical slider. Can be used with the TBS_LEFT style to display tick marks on both sides of the slider control.
-
TBS_LEFT Displays tick marks on the left of a vertical slider. Can be used with the TBS_RIGHT style to display tick marks on both sides of the slider control.
-
TBS_BOTH Displays tick marks on both sides of the slider in any orientation.
-
TBS_ENABLESELRANGE Displays a selection range. When a slider control has this style, the tick marks at the starting and ending positions of a selection range are displayed as triangles (instead of vertical dashes) and the selection range is highlighted. For example, selection ranges might be useful in a simple scheduling application. The user could select a range of tick marks corresponding to hours in a day to identify a scheduled meeting time.
CSliderCtrl Overview | Class Members | Hierarchy Chart
See Also CSliderCtrl::CSliderCtrl