In some cell types, you can display spin buttons, to let users change the value in a cell quickly. Spin buttons are a set of two arrow buttons that appear together, one for increasing the value and one for decreasing the value. Here is a picture of spin buttons on the right-hand side of a number cell. They appear when the cell is in edit mode.
You specify how much the value changes when the user clicks a spin button and you determine whether the value wraps when the minimum or maximum value is reached.
Spin buttons can be displayed in:
- CurrencyCellType (see Setting a Currency Cell)
- DateTimeCellType (see Setting a Date-Time Cell)
- NumberCellType (see Setting a Number Cell)
- PercentCellType (see Setting a Percent Cell)
For the numeric cell types, if the cursor is left of the decimal point, the spin button increments the value using the whole number. If the cursor is to the right, the spin button increments the value using the first, or tenths, decimal place. For the date-time cell type, the day, month, year, etc. are incremented or decremented depending on which part of the date and time the cursor is in. The spin buttons expand vertically the entire height of the cell, so the taller the cell, the bigger the spin buttons. The properties of the Currency, Number, and Percent cell types that relate to spin buttons are listed below. The Date-Time cell type has only the SpinButton property.
Property |
Description |
---|---|
SpinButton |
Sets whether a spin button is displayed when editing. |
SpinDecimalIncrement |
Sets the amount by which the value increments when using the spin buttons and the cursor is in the decimal portion. |
SpinIntegerIncrement |
Sets the amount by which the value increments when using the spin buttons and the cursor is in the integer portion. |
SpinWrap |
Sets whether the value wraps when the minimum or maximum is reached. |
For more information refer to the property for each cell type:
- CurrencyCellType.SpinButton
- DateTimeCellType.SpinButton
- NumberCellType.SpinButton
- PercentCellType.SpinButton
For information on the editable cell types, refer to Working with Editable Cell Types.
For information on other features of cell types, refer to Understanding Additional Features of Cell Types.
Using Code
- Display the spin buttons by setting the SpinButton property to TRUE.
- Specify the amount by which the value in the cell is incremented or decremented when the user clicks on the spin buttons by setting the SpinIncrement property to a nonzero value.
- Specify whether the value in the cell wraps when the cell reaches the minimum or maximum value by setting the SpinWrap property to TRUE or FALSE.
Using the Spread Designer
- Select the cell or cells in the work area.
- In the property list, in the Misc category, select CellType. From the drop-down list, choose the cell type. Now expand the CellType property and various properties are available that are specific to this cell type. Select and set those properties as needed.
Or right-click on the cell or cells and select Cell Type. From the list, select the cell type. In the CellType editor, set the properties you need. Click Apply.
- From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.