New to Telerik UI for WinForms? Start a free 30-day trial

Edits a bounded decimal value using increment/decrement buttons, mouse-wheel input, or direct text entry.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class PlusMinusEditor : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl

Inheritance: objectMarshalByRefObjectComponentControlScrollableControlContainerControlUserControlPlusMinusEditor...

Implements: IBindableComponentIComponentIContainerControlIDisposableIDropTargetISynchronizeInvokeIWin32Window...

Constructors

Initializes the editor controls and connects button, keyboard, validation, and mouse-wheel input.

C#
public PlusMinusEditor()

Properties

Gets or sets the composite format string used to display Value in the text box.

C#
public string FormatString { get; set; }

Gets or sets whether an increment/decrement action at an exact range endpoint wraps to the opposite endpoint.

C#
public bool Loop { get; set; }

Gets or sets the upper bound applied when Value is assigned. Changing this bound does not itself adjust the current value.

C#
public decimal MaxValue { get; set; }

Gets the button that decreases Value by Step.

C#
public RadRepeatButton MinusButton { get; }

Gets or sets the lower bound applied when Value is assigned. Changing this bound does not itself adjust the current value.

C#
public decimal MinValue { get; set; }

Gets the button that increases Value by Step.

C#
public RadRepeatButton PlusButton { get; }

Gets or sets the amount added or subtracted by the increment/decrement actions.

C#
public decimal Step { get; set; }

TextBox

RadTextBox

Gets the text box used to display and edit the formatted value.

C#
public RadTextBox TextBox { get; }

Gets or sets a suffix removed from entered text before parsing. The suffix comparison is case-insensitive.

C#
public string TrimString { get; set; }

Gets or sets the numeric value. Assignments are clamped to MinValue and MaxValue; a change updates the formatted text and raises ValueChanged.

C#
public decimal Value { get; set; }

Methods

Decreases Value by Step, clamping at the configured minimum unless endpoint looping applies.

C#
public void DecreaseValue()

Clean up any resources being used.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

true if managed resources should be disposed; otherwise, false.

Overrides: ContainerControl.Dispose(bool)

Increases Value by Step, clamping at the configured maximum unless endpoint looping applies.

C#
public void IncreaseValue()

Refreshes the displayed value and raises ValueChanged after the value has changed.

C#
protected virtual void OnValueChanged()

Parses the text box contents, removes a matching TrimString suffix, and restores the formatted current value when the remaining text is not a valid decimal.

C#
protected virtual void TryParseUserInput()

Events

Occurs when the accepted value changes after being clamped to the configured range.

C#
public event EventHandler ValueChanged