[]
        
(Showing Draft Content)

C1.WPF.C1NumericBox

C1NumericBox Class

The C1NumericBox control is a numeric editor that allows you to display and edit numeric values in many formats.

Namespace: C1.WPF
Assembly: C1.WPF.4.6.2.dll
Syntax
[TemplatePart(Name = "Text", Type = typeof(C1TextBoxBase))]
[TemplatePart(Name = "Increase", Type = typeof(RepeatButton))]
[TemplatePart(Name = "Decrease", Type = typeof(RepeatButton))]
[TemplateVisualState(Name = "ShowButtons", GroupName = "ButtonsVisibilityStates")]
[TemplateVisualState(Name = "HideButtons", GroupName = "ButtonsVisibilityStates")]
[TemplateVisualState(Name = "MouseOver", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Normal", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Focused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Unfocused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Valid", GroupName = "ValidationStatesStates")]
[TemplateVisualState(Name = "InvalidUnfocused", GroupName = "ValidationStatesStates")]
[TemplateVisualState(Name = "InvalidFocused", GroupName = "ValidationStatesStates")]
[StyleTypedProperty(Property = "ValidationDecoratorStyle", StyleTargetType = typeof(C1ValidationDecorator))]
public class C1NumericBox : Control, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient
Remarks

When the control is empty, or bound to a null value, the Value property returns double.NaN.

Constructors

Name Description
C1NumericBox()

Initializes a new instance of a C1NumericBox.

Fields

Name Description
AllowNullProperty

Identifies the AllowNull dependency property.

ButtonBackgroundProperty

Identifies the ButtonBackground dependency property.

ButtonForegroundProperty

Identifies the ButtonForeground dependency property.

CaretBrushProperty

Identifies the CaretBrush dependency property.

CornerRadiusProperty

Identifies the CornerRadius dependency property.

CultureProperty

The Culture property is obsolete, use the FrameworkElement.Language property instead.

DelayProperty

Identifies the Delay dependency property.

DisabledCuesVisibilityProperty

Identifies the DisabledCuesVisibility dependency property.

FocusBrushProperty

Identifies the FocusBrush dependency property.

FocusCuesVisibilityProperty

Identifies the FocusCuesVisibility dependency property.

FormatProperty

Identifies the Format dependency property.

HandleUpDownKeysProperty

Identifies the HandleUpDownKeys dependency property.

IncrementProperty

Identifies the Increment dependency property.

IntervalProperty

Identifies the Interval dependency property.

IsFocusedProperty

Identifies the IsFocused dependency property.

IsReadOnlyProperty

Identifies the IsReadOnly dependency property.

MaximumProperty

Identifies the Maximum dependency property.

MinimumProperty

Identifies the Minimum dependency property.

MouseOverBrushProperty

Identifies the MouseOverBrush dependency property.

PressedBrushProperty

Identifies the PressedBrush dependency property.

RangeValidationModeProperty

Identifies the RangeValidationMode dependency property.

SelectOnFocusProperty

Identifies the SelectOnFocus dependency property.

SelectionBackgroundProperty

Identifies the C1.WPF.C1NumericBox.SelectionBackground dependency property.

SelectionForegroundProperty

Identifies the C1.WPF.C1NumericBox.SelectionForeground dependency property.

SelectionLengthProperty

Identifies the SelectionLength dependency property.

SelectionStartProperty

Identifies the SelectionStart dependency property.

ShowButtonsProperty

Identifies the ShowButtons dependency property.

TextAlignmentProperty

Identifies the TextAlignment dependency property.

ValidationDecoratorStyleProperty

Identifies the ValidationDecoratorStyle dependency property.

ValueProperty

Identifies the Value dependency property.

WatermarkProperty

Identifies the Watermark dependency property.

Properties

Name Description
AllowNull

Gets or sets whether the user can enter nulls values.

ButtonBackground

Gets or sets the Brush that will be assigned to the Background of the buttons inside the control.

ButtonForeground

Gets or sets the Brush that will be assigned to the Foreground of the buttons inside the control.

CaretBrush

Gets or sets the Brush of the blinking cursor of an input control. When .NET Framework is v3.5, 'CaretBrush' takes no effect.

CornerRadius

Gets or sets a value that represents the degree to which the corners of the element are rounded.

Culture

The Culture property is obsolete, use the FrameworkElement.Language property instead.

Delay

Gets or sets the delay for the Increase and Decrease buttons.

DisabledCuesVisibility

Gets or sets a value indicating whether the disabled visuals of the control are visible.

FocusBrush

Gets or sets the Brush used to highlight the focused control.

FocusCuesVisibility

Gets or sets a value indicating whether the focus visuals of the control are visible.

Format

Gets or sets the value for the Format of the C1NumericBox.

HandleUpDownKeys

Gets or sets If the control handles the Up / Down / PageUp / PageDown keys.

Increment

Gets or sets the increment applied when the user pressed the up/down arrow keys.

Interval

Gets or sets the interval for the Increase and Decrease buttons.

IsFocused

Returns true if the control has the focus.

IsReadOnly

Gets or sets the value that determines if the C1NumericBox is read-only.

Maximum

Gets or sets the maximum value allowed for the C1NumericBox.

Minimum

Gets or sets the minimum value allowed for the C1NumericBox.

MouseOverBrush

Gets or sets the Brush used to highlight the control when it has the mouse over.

PressedBrush

Gets or sets the Brush used to paint a button when it is pressed.

RangeValidationMode

Gets or sets the mode used to validate the range between Minimum and Maximum.

SelectOnFocus

Gets or sets the condition under which all control text is selected when the control receives focus.

SelectionLength

Gets or sets the number of characters in the current selection in the C1NumericBox.

SelectionStart

Gets or sets the starting position of the text selected in the C1NumericBox.

ShowButtons

Shows or hides the buttons for Increment or Decrement.

TextAlignment

Gets or sets how the text should be aligned in the C1NumericBox.

ValidationDecoratorStyle

Gets or sets the style that is applied to the inner C1ValidationDecorator.

Value

Gets or sets the numeric value in the C1NumericBox.

Watermark

Gets or sets the watermark content displayed when the control is empty.

Methods

Name Description
ChangeVisualStateButtonsVisibility(bool)

Updates the current visual state of the ButtonsVisibility visual state group to match the object's properties.

ChangeVisualStateCommon(bool)

Updates the current visual state of the Common visual state group to match the object's properties.

ChangeVisualStateFocus(bool)

Updates the current visual state of the Focus visual state group to match the object's properties.

OnApplyTemplate()

Builds the visual tree for the C1NumericBox control when a new template is applied.

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Invoked whenever the effective value of any dependency property has been updated.

OnValueChanged(PropertyChangedEventArgs<double>)

Raises the ValueChanged event.

Select(int, int)

Selects the text specified by start and length.

Events

Name Description
IsMouseOverChanged

Event raised when the IsMouseOver property has changed.

ValueChanged

Fires when the Value property changes.

Extension Methods