The CalcEdit control allows you to edit numerical values. Using the dropdown calculator, you can perform basic calculations such as addition, multiplication, getting the inverse number and working with a memory register etc.
Use the editor's Properties property to customize the editor. This provides settings controlling the editor's style, text editing and value precision, etc.
The
Value and
EditValue properties can be used to specify the value for the calc editor.
Value accepts only decimal values while
EditValue accepts any object.
Value just returns the result of the conversion of the edit value to a
System.Decimal type.
When the focus is moved to another control or the Enter key is pressed in the edit box (if the RepositoryItemTextEdit.ValidateOnEnterKey property is set to true), the editor converts the edit value to the Decimal type and assigns the result of the conversion back to the edit value.
The calc editor enables you to enter any text (including alpha symbols) in the edit box. This changes the control's edit value (text displayed in the edit box is merely a text representation of the edit value). Before opening the dropdown, the edit value is converted to a decimal value and the dropdown calculator works with the result of this conversion.
If the value evaluated using the dropdown calculator is accepted, it is assigned to the EditValue property. Otherwise, the old value is retained. The RepositoryItemPopupBase.CloseUp topic describes how the dropdown can be closed while accepting or discarding the selected value.
To disable text editing within the edit box, you can set the RepositoryItemButtonEdit.TextEditStyle property to TextEditStyles.DisableTextEditor.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
ControlBase
BaseControl
BaseEdit
TextEdit
ButtonEdit
PopupBaseEdit
CalcEdit