Trackbar
PP Controls offers trackbar controls that contain a slider and optional tick marks. The user moves the slider, using either the stylus or the direction keys. Labels can be added and aligned automatically. In addition a buddy window (i.e. a Textbox) whose value is updated as the slider is moved. Using a buddy textbox in this method allows for events to be supported.
Trackbar - Methods & Properties
NewTrackbar
Creates a new Trackbar and returns the handle of the new control.
| hWnd of parent form (or frame) or placeholder (hWnd) | |
| Specifies the style of the window being created. | |
| If the style PC_PLACEHOLDER is specified, then hWnd refers to the control to be used as a as placeholder. The new Trackbar control will be placed on the form at the same location as this control, with the same size and font. The place-holder control is then hidden. Note: If PC_PLACEHOLDER style is not given, then hWnd specifies the parent window for the new control. The new control is positioned according to the current values of PPCtrl.Left, PPCtrl.Top, PPCtrl.Width and PPCtrl.Height. The font of the parent window is used. |
Tb1 = PPCtrl.NewTrackbar(Frame1.hWnd, TBS_AUTOTICS)
Min, Max
PPCtrl.Max(hWnd) = long
long = PPCtrl.Min(hWnd)
long = PPCtrl.Max(hWnd)
Retrieves/Sets the current minimum and maximum positions for the trackbar control specified by hWnd.
Pos
long = PPCtrl.Pos(hWnd)
Retrieves/Sets the currently position of the slider of the trackbar control specified by hWnd.
level=PPCtrl.Pos(Tb1)
Value
long = PPCtrl.Value(hWnd)
Retrieves/Sets the currently position of the slider of the trackbar control specified by hWnd. (Identical in function to pos)
level=PPCtrl.Value(Tb1)
SelStart, SelEnd
PPCtrl.SelEnd(hWnd) = long
Sets the start/end of the current selection range for the trackbar control specified by hWnd based on a given format string. The trackbar highlights the available range and displays triangular tick marks at the start and end.
PPCtrl.SelEnd(Tb1)=40
TicFreq
Sets the interval for the automatic tick marks, for the trackbar control specified by hWnd based on a given format string. You can use the TBS_AUTOTICKS style to automatically display additional tick marks at regular intervals along the trackbar. By default, a TBS_AUTOTICKS trackbar displays a tick mark at each increment of the trackbar's range.
NewTick
Sets a tick mark in the trackbar specified by hWnd at the specified position.
BuddyLow, BuddyHigh
PPCtrl.BuddyHigh(hWnd) = hWnd
Assigns a window as the buddy label window for the trackbar control specified by hWnd. Trackbar buddy windows are automatically displayed in a location relative to the control's orientation (horizontal or vertical).
PPCtrl.BuddyHigh(TB1)=Text2.hWnd
Buddy
Sets a control as the buddy window for the trackbar control specified by hWnd. The buddy window of a trackbar is automatically updated as the slider is moved.
LabelLow, LabelHigh
PPCtrl.LabelHigh(hWnd) = string
Creates and assigns a control as the buddy label window for the trackbar control specified by hWnd. Trackbar buddy windows are automatically displayed in a location relative to the control's orientation (horizontal or vertical). If a place holder is specified when creating the trackbar, then the font of the placeholder is used for the label control.
PPCtrl.LabelHigh(TB1)=”Label 2”
Trackbar – Styles
TBS_AUTOTICKS
The trackbar control has a tick mark for each increment in its range of values.
TBS_BOTH
The trackbar control displays tick marks on both sides of the control. This will be both top and bottom when used with TBS_HORZ or both left and right if used with TBS_VERT.
TBS_BOTTOM
The trackbar control displays tick marks below the control. This style is valid only with TBS_HORZ.
TBS_ENABLESELRANGE
The trackbar control 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_HORZ
The trackbar control is oriented horizontally. This is the default orientation.
TBS_LEFT
The trackbar control displays tick marks to the left of the control. This style is valid only with TBS_VERT.
TBS_NOTHUMB
The trackbar control does not display a slider.
TBS_NOTICKS
The trackbar control does not display any tick marks.
TBS_RIGHT
The trackbar control displays tick marks to the right of the control. This style is valid only with TBS_VERT.
TBS_TOP
The trackbar control displays tick marks above the control. This style is valid only with TBS_HORZ.
TBS_VERT
The trackbar control is oriented vertically.
