Calculator Class

Represents a calculator.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public class Calculator :
    Control,
    ICalculatorViewOwner
Public Class Calculator
    Inherits Control
    Implements ICalculatorViewOwner

Remarks

The Calculator is shown in the image below:

Calculator_DigitalDisplay

Create a Calculator

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">

<dxe:Calculator />

Calculator Features

  • Basic Math Functions (add, subtract, multiply, etc.)
  • Memory Operations - store, recall, add (M+) and subtract (M-). The value stored in the calculator's memory is returned by the Calculator.Memory property.
  • Calculation History - the calculation history is stored by the Calculator.History property.
  • Keyboard Support
  • Configurable Precision - use the Calculator.Precision property to specify the maximum number of digits displayed to the right of the decimal point.
  • Optional Digital Display - use the Calculator.IsDigitalDisplay property to specify whether the calculator has the digital or text display.
  • Customizable Error Text - handle the Calculator.CustomErrorText event to provide a custom error description.
  • Localizable UI

Displayed Value

Use the Value property to get or set the displayed value. After the Value property's value has been changed, the Calculator.ValueChanged event is fired.

To obtain the text displayed within the calculator, use the Calculator.DisplayText property.

See Also