Skip to main content
A newer version of this page is available. .

PopupCalcEdit Class

Represents a calculator displayed within a dropdown window.

Namespace: DevExpress.Xpf.Editors

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Core, DevExpress.Wpf.Core

Declaration

public class PopupCalcEdit :
    PopupBaseEdit

Remarks

The PopupCalcEdit is shown in the image below:

PopupCalcEdit

Tip

The PopupCalcEdit class inherits its features from the PopupBaseEdit class.

Refer to the PopupBaseEdit class description for information on derived features and API.

Create a PopupCalcEdit

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

    <!-- Adds a default PopupCalcEdit to your window -->
    <dxe:PopupCalcEdit />
</Window>

Editor Value

The editor’s value can be specified using the BaseEdit.EditValue or PopupCalcEdit.Value property.

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

<!-- Specify value using the BaseEdit.EditValue property -->
<dxe:PopupCalcEdit EditValue="0"/>

<!-- Specify value using the PopupCalcEdit.Value property -->
<dxe:PopupCalcEdit Value="0"/>

To respond to changing the editor’s value, handle the BaseEdit.EditValueChanged event. To check the new value’s validity, handle the BaseEdit.Validate event.

Calculation Features

PopupCalcEdit features include:

  • Basic Math Functions (add, subtract, multiply, etc.)
  • Memory Operations - store, recall, add (M+) and subtract (M-).
  • Keyboard and Mouse Wheel Support
  • Configurable Precision - use the PopupCalcEdit.Precision property to specify the maximum number of digits displayed to the right of the decimal point.
  • Customizable Error Text - handle the PopupCalcEdit.CustomErrorText event to provide a custom error description.

Layout

The IsPopupAutoWidth property specifies whether the popup calculator’s width is automatically adjusted to the editor’s width.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PopupCalcEdit class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also