Spread Windows Forms 6.0 Product Documentation
Setting up the Formula Text Box
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Customizing Interaction in Cells > Using the Additional Spread Controls > Setting up the Formula Text Box

Glossary Item Box

You can set up a floating formula bar that end users can use to add formulas. The formula bar is similar to the formula editor available to the developer and has the appearance of a text box. The formula bar provides a list of calculation functions. It also provides a visual method of selecting cell ranges for the formula.

Floating formula bar

Refer to the example below to see how to create the formula text box.

Setting up the Formula Text Box

To setup the formula bar, use the FormulaTextBox class.

The AllowUserFormulas method allows the user to type formulas in the cell.

If you set the AllowUserFormulas property to true for the control, then the formulas that are typed in a cell show up in the formula bar.

Using the Formula Text Box

To use the formula text box, type the equal sign (=) and then start typing the name of the formula. This brings up a list of functions that start with that letter. You can then type the left parenthesis and either select a block of cells by dragging the mouse over that range or type cell values by absolute or relative reference. The figure below shows the selection of a range of cells from A1 to B3.

Example of Conditional Format

See Also

For more information on formulas, refer to Managing Formulas in Cells and the Formula Reference.

For more information on allowing the user to enter formulas, refer to Allowing the User to Enter Formulas.

Return to Using the Additional Spread Controls.

Using Code

Create the formula editor and attach it to the control.


This example code creates the floating formula bar.

C# Copy Code
FarPoint.Win.Spread.FormulaTextBox editor = new FarPoint.Win.Spread.FormulaTextBox();
editor.Location = new Point(0, 0);
editor.Size = new Size(80, 20);
// This line will disconnect the formula bar from the control
// editor.Detach();
VB Copy Code
Dim editor As New FarPoint.Win.Spread.FormulaTextBox
editor.Location = New Point(0, 0)
editor.Size = New Size(80, 20)
‘ This line will disconnect the formula bar from the control
‘ editor.Detach()

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