Home > Language Reference > Classes
AdjustableControl Class
+ Object
+ Display
+ UIComponent
+ Control
+ AdjustableControl
Description
The AdjustableControl class implements the common behaviors of controls that allow selection of a ranged numeric value. Its derived classes are Scrollbar, Slider and SpinButton. Like all the classes derived from UIComponent, this class is not instantiable, cloneable or derivable. The only instances available to the programmer are those automatically generated by HB++ when you place this control on a form.
The range of valid values is defined by the Min and Max properties, the current value being held in the Value property. When the user clicks between the cursor and one of the extremes of the control, the current value is increased or decreased by the value held by LargeChange. The SetValues method allows all these values to be modified together.
The Track event is raised when the user moves the cursor whilst the Scroll event is raised when the user releases the cursor. Note: This event is not raised by the SpinButton control.
The example below which should be copied onto a form containing a scrollbar and a field, implements a metronome. The user chooses the number of beats per minute by scrolling a scrollbar.
Private T as New Timer Private Sub Form_Load() Scrollbar1.SetValues 40, 240, 10, 90 Scrollbar1_Scroll Scrollbar1.Value T.Enabled = True End Sub Private Sub Form_Unload() T.Enabled = False End Sub Private Sub Scrollbar1_Track(ByVal iValue As Integer) Field1.Text = iValue & " bpm" End Sub Private Sub Scrollbar1_Scroll(ByVal iValue As Integer) Scrollbar1_Track iValue T.Interval=60000/CLng(iValue) End Sub Private Sub T_Timer() Beep 100, 20 End Sub
Note that the Track event is intercepted to update the contents of field, giving the user feedback on the current position of the cursor, whilst the Scroll event is used to update the timer itself.
Members
| Members | Description |
| LargeChange | Value added or substracted to the Value property when the user clicks the area between the scroll box and one of the scroll arrows. |
| Max | Maximum value for the control. |
| Min | Minimum value for the control. |
| Scroll | Raised when the user releases the cursor of the scrollbar or slider. |
| SetValues | Sets the value of all the control properties. |
| Track | Raised when the user moves the cursor of the scrollbar or slider. |
| Value | Current control value. |
| Inherited from Control | Description |
| DrawFocusRing | Draws the focus ring. |
| GotFocus | Event raised when the control gains the focus. |
| Layer | Layer to which the control belongs. |
| LostFocus | Event raised when the control loses the focus. |
| NavFlags | Navigation flags for the control. |
| RemoveFocusRing | Erase the focus ring. |
| Tag | String associated with the control. |
| Visible | Indicates if a control is visible or not. |
| Inherited from UIComponent | Description |
| ComponentToScreen | Converts coordinates relative to a component into coordinates relative to the screen. |
| FiveWayNavigator | Event raised when the user presses one of the 5-way navigator keys. |
| Height | Element height. |
| Left | Distance between the left edge of the form and the left edge of the element. |
| Move | Moves or resizes an element. |
| PenDown | Event raised when the user touches an UI element with the stylus. |
| PenMove | Event raised when the user moves the stylus. |
| PenUp | Event raised when the user releases the stylus. |
| ScreenToComponent | Converts coordinates relative to the screen into coordinates relative a component. |
| Top | Distance between the top edge of the form and the top edge of the element. |
| UIRef | Internal reference to a control. |
| Width | Element width. |
| Inherited from Display | Description |
| Arc | Draws an arc. |
| BackColor | Background color. |
| BatchLimit | Size of the graphics instruction buffer. |
| CoordinateSystem | Coordinates system. |
| CopyArea | Efficiently copies part of a Display object to another. |
| DrawFont | Font used to draw the text. |
| Flush | Empties the graphics instruction buffer. |
| FontMetrics | Returns a FontMetrics object describing the physical charateristics of the currently active font. |
| ForeColor | Foreground color. |
| GetPixel | Queries the color of a given pixel. |
| hWin | Returns the window handle. |
| Line | Draws a line. |
| Oval | Draws a circle or ellipse. |
| Pattern | Defines the pattern used to fill drawings. |
| Polygon | Draws a polygon. |
| PutPixel | Sets the color of a pixel. |
| Rectangle | Draw a rectangle. |
| ResID | Identifier of the resource associated with the object. |
| ScaleFont | Enable or disable font scaling. |
| TextColor | Text color. |
| TextOut | Draw text. |
| Inherited from Object | Description |
| ClassID | Returns the type identifier corresponding to the actual class of the object. |
| Implements | Determines whether the object implements the features of a given class. |
| Iterate | Event raised to iterate over the elements of a container object. |
| Recipient | Recipient of events sent by the object. |
| Serialize | Event raised to serialize the object content into a stream. |
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |