Trackbar

This section contains information about the programming elements used with trackbar controls.

Overviews

Topic Contents
About Trackbar Controls A trackbar is a window that contains a slider (sometimes called a thumb) in a channel, and optional tick marks. When the user moves the slider, using either the mouse or the direction keys, the trackbar sends notification messages to indicate the change.
Using Trackbar Controls This section provides implementation details and examples for trackbar controls.

Messages

Topic Contents
TBM_CLEARSEL Clears the current selection range in a trackbar.
TBM_CLEARTICS Removes the current tick marks from a trackbar. This message does not remove the first and last tick marks, which are created automatically by the trackbar.
TBM_GETBUDDY Retrieves the handle to a trackbar control buddy window at a given location. The specified location is relative to the control's orientation (horizontal or vertical).
TBM_GETCHANNELRECT Retrieves the size and position of the bounding rectangle for a trackbar's channel. (The channel is the area over which the slider moves. It contains the highlight when a range is selected.)
TBM_GETLINESIZE Retrieves the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the or keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.
TBM_GETNUMTICS Retrieves the number of tick marks in a trackbar.
TBM_GETPAGESIZE Retrieves the number of logical positions the trackbar's slider moves in response to keyboard input, such as the or keys, or mouse input, such as clicks in the trackbar's channel. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.
TBM_GETPOS Retrieves the current logical position of the slider in a trackbar. The logical positions are the integer values in the trackbar's range of minimum to maximum slider positions.
TBM_GETPTICS Retrieves the address of an array that contains the positions of the tick marks for a trackbar.
TBM_GETRANGEMAX Retrieves the maximum position for the slider in a trackbar.
TBM_GETRANGEMIN Retrieves the minimum position for the slider in a trackbar.
TBM_GETSELEND Retrieves the ending position of the current selection range in a trackbar.
TBM_GETSELSTART Retrieves the starting position of the current selection range in a trackbar.
TBM_GETTHUMBLENGTH Retrieves the length of the slider in a trackbar.
TBM_GETTHUMBRECT Retrieves the size and position of the bounding rectangle for the slider in a trackbar.
TBM_GETTIC Retrieves the logical position of a tick mark in a trackbar. The logical position can be any of the integer values in the trackbar's range of minimum to maximum slider positions.
TBM_GETTICPOS Retrieves the current physical position of a tick mark in a trackbar.
TBM_GETTOOLTIPS Retrieves the handle to the tooltip control assigned to the trackbar, if any.
TBM_GETUNICODEFORMAT Retrieves the Unicode character format flag for the control.
TBM_SETBUDDY Assigns a window as the buddy window for a trackbar control. Trackbar buddy windows are automatically displayed in a location relative to the control's orientation (horizontal or vertical).
TBM_SETLINESIZE Sets the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the or keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.
TBM_SETPAGESIZE Sets the number of logical positions the trackbar's slider moves in response to keyboard input, such as the or keys, or mouse input, such as clicks in the trackbar's channel. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.
TBM_SETPOS Sets the current logical position of the slider in a trackbar.
TBM_SETPOSNOTIFY Sets the current logical position of the slider in a trackbar.
TBM_SETRANGE Sets the range of minimum and maximum logical positions for the slider in a trackbar.
TBM_SETRANGEMAX Sets the maximum logical position for the slider in a trackbar.
TBM_SETRANGEMIN Sets the minimum logical position for the slider in a trackbar.
TBM_SETSEL Sets the starting and ending positions for the available selection range in a trackbar.
TBM_SETSELEND Sets the ending logical position of the current selection range in a trackbar. This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style.
TBM_SETSELSTART Sets the starting logical position of the current selection range in a trackbar. This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style.
TBM_SETTHUMBLENGTH Sets the length of the slider in a trackbar. This message is ignored if the trackbar does not have the TBS_FIXEDLENGTH style.
TBM_SETTIC Sets a tick mark in a trackbar at the specified logical position.
TBM_SETTICFREQ Sets the interval frequency for tick marks in a trackbar. For example, if the frequency is set to two, a tick mark is displayed for every other increment in the trackbar's range. The default setting for the frequency is one; that is, every increment in the range is associated with a tick mark.
TBM_SETTIPSIDE Positions a tooltip control used by a trackbar control. Trackbar controls that use the TBS_TOOLTIPS style display tooltips.
TBM_SETTOOLTIPS Assigns a tooltip control to a trackbar control.
TBM_SETUNICODEFORMAT Sets the Unicode character format flag for the control. This message allows you to change the character set used by the control at run time rather than having to re-create the control.

Notifications

Topic Contents
NM_CUSTOMDRAW (trackbar) Sent by a trackbar control to notify its parent windows about drawing operations. This notification code is sent in the form of a WM_NOTIFY message.
NM_RELEASEDCAPTURE (trackbar) Notifies a trackbar control's parent window that the control is releasing mouse capture. This notification code is sent in the form of a WM_NOTIFY message.
TRBN_THUMBPOSCHANGING Notifies that the thumb position on a trackbar is changing. This notification code is sent in the form of a WM_NOTIFY message.

Constants

Topic Contents
Custom Draw Values This section lists the values used to identify a trackbar control's parts.
Trackbar Control Styles This section contains information about the styles used with trackbar controls.