Version

About WinCalcManager

The WinCalcManager™ Assembly is a non-visual component that extends the capabilities of all controls on a form. To implement formulas on your form, drag the UltraCalcManager component from the Toolbox onto your form. Once this is done, almost all of the controls on the form will have a new property called CalcSettings . Some controls (like the WinGrid) support special handling of formulas, and will not show the CalcSettings property. These controls handle formulas in other ways. For example, WinGrid has a Formula property on the Column and SummarySettings objects. CalcSettings is of type UltraCalcSettings which has the following properties:

Property Name Description

Gets or sets the alias name of the control.

Gets or sets where the ErrorIcon from the ErrorProvider should be aligned in relationship to the control, if an error occurs in a calculation.

Gets or sets the value displayed in the element when an error occurs in the formula.

Gets or sets the formula which will be used to set the value of this object.

Gets or sets which property (Text, Tag, Value, etc., based on the element) is used as either the source or target of any calculations involving the control.

Note
Note

that in order for a control to function properly as the Source value of a calculation, the property must also have a changed event. For example, if using the Text property, the control must have a TextChanged event. Otherwise, the CalcManager cannot detect changes in the property.

Tag

Gets or sets any additional information that should be associated with this object.

Gets or sets a type to use for conversion purposes when the UltraCalcManager interprets the value from the control.

  1. The following image demonstrates the WinTextEditor control on a form with its properties extended by the CalcManager component.

show properties added to control in the properties window
  1. To add formulas to an element, set the PropertyName, and then simply click the ellipses button on the Formula property to invoke the Formula Builder.

shows the ellipse button on the formula property
  1. Once the Formula Builder is displayed, the left column displays 2 tabs. The first tab lists the elements on the form that can be used in a formula, along with any custom NamedReferences. The second tab lists all of the formulas that can be used.

shows the formula builder available at design time for wincalcmanager
  1. To create a formula, simply double-click the name of an element on the first tab, or drag-and-drop the element name in the list to the formula editor. Use the formula editor’s toolbar to add basic math symbols to your calculation. As you modify the formula in the formula editor, the formula is being checked for syntax errors in the background. If a formula entered is invalid, then you will be notified of the column and line number where you need to make the change.