If the user presses F4 or double-clicks any of the several numeric cell types when the cell is in edit mode, a pop-up calculator appears, as shown in the following figure.
You can use the calculator to type a number or to perform a calculation. The result from the calculator is placed in the numeric cell. The cell types that allow a calculator pop-up are:
When using the controls, you must click the OK or Cancel button to close the control. You can change the text of the buttons at the bottom with the SetCalculatorText method for that cell type.
Note that the text appears centered on the button. If you set custom text for the buttons, try to limit your text to eight or nine characters in length. The button will display ten characters, but the first and last appear very close to the edges of the button.
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.
This example sets the text of the buttons.
C# |
Copy Code
|
---|---|
FarPoint.Win.Spread.CellType.CurrencyCellType ctest = new FarPoint.Win.Spread.CellType.CurrencyCellType(); ctest.SetCalculatorText("Accept", "Cancel"); fpSpread1.Sheets[0].Cells[0, 0].CellType = ctest; |
VB |
Copy Code
|
---|---|
Dim ctest As New FarPoint.Win.Spread.CellType.CurrencyCellType() ctest.SetCalculatorText("Accept", "Cancel") fpSpread1.Sheets(0).Cells(0, 0).CellType = ctest |