Spread Windows Forms 7.0 Product Documentation
Customizing the Pop-Up Calculator Control
Support Options
Spread Windows Forms 7.0 Product Documentation > Developer's Guide > Customizing Interaction with Cell Types > Understanding Additional Features of Cell Types > Customizing the Pop-Up Calculator Control

Glossary Item Box

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 below.

Pop-Up Calculator Control

Pop-up Calculator

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, only clicking on the OK or Cancel buttons closes 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. 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.

Using Code

  1. Define the cell by creating an instance of the CurrencyCellType class (or other number type cell).
  2. Specify the text for the buttons.
  3. Assign the cell type to a cell or range of cells by setting the CellType property for a cell, column, row, or style.

Example

Set the text of the buttons.

C# Copy Code
FFarPoint.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

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.