# Setting up the Formula Provider

Use Spread.NET to develop front-ends to database applications. It gives access to multiple sheets using many types of cells and predefined sheet styles.

## Content

You can add a formula provider control to the form. The provider control can be added to the **Toolbox**. Find the formula provider control in the list of .NET controls that can be added to the **Toolbox** and select it.
![Floating formula bar](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/formulaprovidertoolbox.png)

## Setting up the Formula Provider Control

Double-click the formula provider control after selecting it from the **Toolbox**.
Two design properties will be added to each control on the form. The **Formula on Formula Provider** property is the property for setting a formula. The **Formula Trigger Event on Formula Provider** property allows you to determine which event will cause the formula to update.

## Using the Formula Provider

The following basic example shows how to use the formula provider at design time. This example uses two text box controls and the formula provider. The second text box displays the value from the first text box. The formula for the second text box (**Formula on Formula Provider** property) has been set to be equal to the first text box. The trigger event (**FormulaTriggerEvent**) has been set to the **TextChanged** event.
![Example of Conditional Format](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/formulaproviderdesign.png)
For more information on formulas, refer to [Formulas in Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula) and the [Formula Reference](https://developer.mescius.com/spreadnet/docs/latest/online-formula/overview.html).

## Using Code

Add the formula provider and two text box controls to the form and set the [SetFormula](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Model.DefaultSheetDataModel.SetFormula.html) and TextChanged Event methods for the formula provider.

## Example

This example gets the typed data from text box 1 and puts it in text box 2.

```csharp
FormulaProvider1.SetFormula(TextBox2, "=TextBox1");
FormulaProvider1.SetFormulaTriggerEvent(TextBox1, "TextChanged");
```

```vbnet
FormulaProvider1.SetFormula(TextBox2, "=TextBox1")
FormulaProvider1.SetFormulaTriggerEvent(TextBox1, "TextChanged")
```