Share via


TrackBarView_t::DrawThumb

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method draws the thumb for a trackbar.

Syntax

static void DrawThumb(
  HWND hwnd,
  HDC hdc,
  DWORD style,
  int iThumbHeight,
  int iThumbWidth,
  LPRECT lprc,
  BOOL fSelected
);

Parameters

  • hwnd
    [in] Handle to a trackbar window.
  • hdc
    [in] Handle to the device context for the window.
  • style
    [in] DWORD that specifies the style of the trackbar. The following table shows the possible values.

    Trackbar control styles Description

    TBS_AUTOTICKS

    The trackbar has a tick mark for each increment in its range of values.

    TBS_BOTH

    The trackbar displays tick marks on both sides of the control. These sides are both top and bottom when used with TBS_HORZ or both left and right when used with TBS_VERT.

    TBS_BOTTOM

    The trackbar displays tick marks below the control. This style is only valid with TBS_HORZ.

    TBS_ENABLESELRANGE

    The trackbar displays a selection range only. 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.

    TBS_FIXEDLENGTH

    The trackbar control allows the size of the slider to be changed with the TBM_SETTHUMBLENGTH message.

    TBS_HORZ

    The trackbar is oriented horizontally. This orientation is the default orientation.

    TBS_LEFT

    The trackbar displays tick marks to the left of the control. This style is only valid with TBS_VERT.

    TBS_NOTHUMB

    The trackbar does not display a slider.

    TBS_NOTICKS

    The trackbar does not display any tick marks.

    TBS_REVERSED

    The trackbar is reversed, so that a smaller number indicates higher and a larger number indicates lower.

    TBS_RIGHT

    The trackbar displays tick marks to the right of the control. This style is only valid with TBS_VERT.

    TBS_TOOLTIPS

    The trackbar supports ToolTips. When you create a trackbar by using this style, a default ToolTip control that displays the current position of the slider is automatically created.

    TBS_TOP

    The trackbar displays tick marks above the control. This style is only valid with TBS_HORZ.

    TBS_VERT

    The trackbar is oriented vertically.

  • iThumbHeight
    [in] Integer that specifies the height of the thumb, in pixels.
  • iThumbWidth
    [in] Integer that specifies the width of the thumb, in pixels.
  • lprc
    [in] Long pointer to a RECT structure that specifies the bounding rectangle of the thumb of the trackbar. For a horizontal trackbar, set the members of the RECT structure to the coordinates that the members ordinarily contain. For a vertical trackbar, swap the left and top members of the RECT structure, and swap the right and bottom members of the RECT structure. The following table shows the coordinates that you should use for the members of the RECT structure when calling this method for a vertical trackbar.

    Member Description

    left

    Specifies the y-coordinate of the upper-left corner of the bounding rectangle of the trackbar.

    top

    Specifies the x-coordinate of the upper-left corner of the bounding rectangle of the trackbar.

    right

    Specifies the y-coordinate of the lower-right corner of the bounding rectangle of the trackbar.

    bottom

    Specifies the x-coordinate of the lower-right corner of the bounding rectangle of the trackbar.

  • fSelected
    [in] Boolean that specifies whether the thumb is selected. TRUE indicates that the thumb is selected. FALSE indicates that the thumb is not selected.

Return Value

None.

Requirements

Header trackbarview.hpp
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

TrackBarView_t
TBM_SETTHUMBLENGTH
RECT