[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomUpDown

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCustomUpDown - base class for TUpDown - a pair of arrow-like buttons which are used to increment or decrement some controlled variable; often attached to a scroll-bar but can also control a digital numeric display.

## Declaration

Source position: comctrls.pp line 1922

`type TCustomUpDown = class(TCustomControl)`
`protected`
`class procedure WSRegisterClass; override;` |  | Registers this component class with the current WidgetSet.
`procedure AdjustPos();` |  | Applies changes to the control value using its increment and decrement buttons.
`procedure InitializeWnd; override;` |  | Initializes the window handle for the control.
`procedure AssociateKeyDown();` |  | Implements the OnKeyDown event handler assigned to the Associate control in the class instance.
`procedure AssociateMouseWheel();` |  | Implements an OnMouseWheel event handler assigned to the Associate control in the class instance.
`procedure OnAssociateChangeBounds();` |  | Implements an OnChangeBounds event handler assigned to the Associate control in the class instance.
`procedure OnAssociateChangeEnabled();` |  | Implements an OnEnabledChanged event handler assigned to the Associate control in the class instance.
`procedure OnAssociateChangeVisible();` |  | Implements an OnVisibleChanged event handler assigned to the Associate control in the class instance.
`function DoMouseWheelDown(); override;` |  | Performs actions when a mouse wheel down event occurs for the control.
`function DoMouseWheelUp(); override;` |  | Performs actions when a mouse wheel up event occurs for the control.
`function DoMouseWheelLeft(); override;` |  | Performs actions when a mouse wheel left event occurs for the control.
`function DoMouseWheelRight(); override;` |  | Performs actions when a mouse wheel right event occurs for the control.
`procedure MouseEnter; override;` |  | Performs actions when the mouse pointer enters the control.
`procedure MouseLeave; override;` |  | Performs actions when the mouse pointer leaves the control.
`procedure DoSetBounds(); override;` |  | Applies the specified bounds to the control.
`procedure SetEnabled(); override;` |  | Sets the value for the Enabled property.
`class function GetControlClassDefaultSize; override;` |  | Class function which returns the default size used for the class.
`procedure CalculatePreferredSize(); override;` |  | Calculates the preferred width and height for the control.
`function CanChange; virtual;` |  | Indicates whether a change using the control can be applied.
`procedure Notification(); override;` |  | Notification calls inherited method; if the operation requires removal of the associate control, this is performed.
`procedure Click(); virtual; overload;` |  | Handles a mouse click on a speed button in the control.
`property AlignButton: TUDAlignButton; [rw]` |  | AlignButton - how to align the button: left or right.
`property ArrowKeys: Boolean; [rw]` |  | Enables or disables button clicks when cursor keys are pressed in the Associate control.
`property Associate: TWinControl; [rw]` |  | Control used to display and edit the Position for the control.
`property Increment: Integer; [rw]` |  | The amount by which Position is increased or decreased for each button click.
`property Max: SmallInt; [rw]` |  | The largest value allowed in the Position property.
`property Min: SmallInt; [rw]` |  | The smallest value allowed in the Position property.
`property MinRepeatInterval: Byte; [rw]` |  | Minimum interval that must elapse before the action for the control is repeated.
`property OnChanging: TUDChangingEvent; [rw]` |  | Event handler signalled prior to changing the value in the Position property.
`property OnChangingEx: TUDChangingEventEx; [rw]` |  | Event handler signalled to determine if the control can change the value in the Position property.
`property OnClick: TUDClickEvent; [rw]` |  | Event handler signalled when a button on the control is clicked.
`property Orientation: TUDOrientation; [rw]` |  | Indicates the horizontal or vertical orientation for the button(s) displayed on the control.
`property Position: SmallInt; [rw]` |  | The current position (or value) for the control as a SmallInt type.
`property Thousands: Boolean; [rw]` |  | Enables or disables use of the thousands separator when displaying the text for the Position property.
`property Flat: Boolean; [rw]` |  | Indicates whether the speed buttons for the control are drawn using a flat appearance.
`property Wrap: Boolean; [rw]` |  | Enables or disables wrap-around for the value in Position when it exceeds the limits in Min or Max.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destroy - destructor for TCustomUpDown: removes connection with associate control and calls inherited Destroy.
`end;`

## Inheritance

`TCustomUpDown` |  | TCustomUpDown - base class for TUpDown - a pair of arrow-like buttons which are used to increment or decrement some controlled variable; often attached to a scroll-bar but can also control a digital numeric display.
`TCustomControl` |  | The base class for windowed controls which paint themselves.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCustomUpDown - base class for TUpDown - a pair of arrow-like buttons which are used to increment or decrement some controlled variable; often attached to a scroll-bar but can also control a digital numeric display.

The control definition itself does not specify the variable upon which the buttons operate. The application programmer is responsible for supplying an event handler for OnClick to determine which button has been selected (designated btNext or btPrev) and incrementing or decrementing the variable in the control with which the UpDown is associated.

The amount by which the variable is changed is set by the integer property Increment with the optional multiplier Thousands (a boolean property).

For example the UpDown control may be used to move a slider up and down a scale by a specified amount for each click; alternatively a number may be displayed in a text box and clicking the buttons of the UpDown control may increment or decrement the number displayed by a specified amount.