Skip to main content

TdxCustomZoomTrackBar.Position Property

Specifies the current position of the zoom track bar’s thumb.

Declaration

property Position; default 100;

Property Value

Type Default
Integer 100

Remarks

End-users can change the position of the zoom track bar’s thumb (and thus its edit value) using any of the following methods:

  • Drag the thumb with the mouse;

  • Click the zoom track bar at the required position;

  • Click the change buttons;

  • Press the arrow keys, or the Page Up, Page Down, Home, or End key when the zoom track bar editor is focused.

When any of these methods are used, the Properties.OnChange event is raised. Thus, you can provide a proper response to changing the edited value. To do so, you will need to obtain the current position of the zoom track bar’s slider and this is available via the Position property.

You can also use the Position property to change the edited value programmatically. Note that this property value is restricted to the range specified by the Properties.Min and Properties.Max property values. Trying to assign a value below the allowed range will result in setting the Position to the Properties.Min property value. Similarly, assigning a value beyond the range will assign it to the Properties.Max property value. Changing the Position property value programmatically results in raising the Properties.OnChange event.

Setting the Position property programmatically is useful, for instance, when you want to synchronize the zoom track bar editor with another control. An example can be using the zoom track bar editor together with a text editor. In this case, the zoom track bar editor can be used for rough value modifications while the text editor allows precise value changes. This assumes that the text editor’s value changes are handled and the Position property of the zoom track bar editor is modified as needed. The Properties.OnChange event of the zoom track bar editor must also be handled to update the bound control in this case.

The default value of the Position property is 100.

See Also