WindowsForms-docs/WindowsForms/Numeric-TextBox/Overview.md

5.7 KiB

layout title description platform control documentation
post About Windows Forms Numeric TextBox control | Syncfusion Learn here all about introduction of Syncfusion Windows Forms Numeric TextBox (SfNumericTextBox) control and more details. WindowsForms SfNumericTextBox ug

Windows Forms Numeric TextBox (SfNumericTextBox) Overview

The NumericTextBox control is an advanced text box control that allows you to enter numeric values in a specific format such as numeric, currency, and percent. It also provides support to display value with custom units.

Overview of SfNumericTextBox

Key Features

Different modes - Supports specific modes such as numeric, currency, and percent.

Value range support - Allows us to define and validate the value based on minimum and maximum values.

Formatting - Supports to format the value as users need.

Hide trailing zeros - Supports hiding trailing zeros.

Watermark - Supports to display watermark text when value is null.

Custom units - Supports to display values with custom units that can be appended as prefix or suffix.

Choose between different textbox controls

Syncfusion WinForms suite comes up with the following different textboxes:

SfNumericTextBox

The SfNumericTextBox control is an advanced textbox that allows you to enter numeric values in a specific format such as value. The currency or percent value can also be displayed with custom units. Supports hiding trailing zeros and displaying values with custom units.

CurrencyTextBox

CurrencyTextBox is a textbox-derived control that implements all functionalities to format currency input and validation. Provides support for clipboard operations that are compatible with currency data.

PercentTextBox

PercentTextBox is a textbox-derived control that can display double data type values in percentage. It supports display and collection of percentage values.

IntegerTextBox

IntegerTextBox is derived from the Windows Forms Framework TextBox control. Displays integer data type values alone.

SfNumericTextBox vs existing numeric textbox controls

Both SfNumericTextBox and existing numeric textbox controls (IntegerTextBox, PercentTextBox, and CurrencyTextBox) are used for the same purpose. But, the SfNumericTextBox control offers rich set of features over existing numeric textbox controls (IntegerTextBox, PercentTextBox, and CurrencyTextBox). To hide by trailing zeros and prefix or suffix and watermark text, use SfNumericTextBox.

The list of some specific API differences between SfNumericTextBox and existing numeric textbox controls (IntegerTextBox, PercentTextBox, and CurrencyTextBox) is as follows.

{{'**SfNumericTextBox**'| markdownify }} {{'**IntegerTextBox, PercentTextBox and CurrencyTextBox**'| markdownify }} {{'**Description**'| markdownify }}
Value Text Displays the values in textbox.
WatermarkText AllowNull Sets the null value in textbox.
MaxValue MaxValue Sets the maximum value in textbox.
MinValue MinValue Sets the minimum value in textbox.
Style.BorderColor BorderColor Applies the color of textbox border.
ThemeName Style Applies the visual styles.
PositiveForeColor PositiveColor sets the color only in positive values.
NegativeForeColor NegativeColor sets the color only in negative values.
ZeroForeColor ZeroColor sets the color only in zero values.

The list of features in SfNumericTextBox over existing numeric textbox controls (IntegerTextBox, PercentTextBox, and CurrencyTextBox) is as follows.

{{'**Feature**'| markdownify }} {{'**Description**'| markdownify }}
Different modes Supports specific modes like numeric, currency, and percent. To learn more about different modes in SfNumericTextBox, refer to {{'[here](https://help.syncfusion.com/windowsforms/numeric-textbox/gettingstarted#different-types-of-format-modes)'| markdownify }}.
Formatting Formats the value based on the user needs. To learn more about format modes in SfNumericTextBox, refer to {{'[here](https://help.syncfusion.com/windowsforms/numeric-textbox/formatting#formatmode)'| markdownify }}.
Hide trailing zeros Hides trailing zeros. To learn more about hiding zeros in SfNumericTextBox, refer to {{'[here](https://help.syncfusion.com/windowsforms/numeric-textbox/formatting#hiding-trailing-zeros)'| markdownify }}.
Custom units Displays the values with custom units which can be appended prefix or suffix. To learn more about custom units in SfNumericTextBox, refer to {{'[here](https://help.syncfusion.com/windowsforms/numeric-textbox/formatting#prefix-and-suffix)'| markdownify }}.