Loading...
Loading...
Implements the Syncfusion WPF CurrencyTextBox control for formatted currency input with culture-specific formatting. Use this when adding currency input fields, financial data entry controls, or decimal value inputs with currency symbols in WPF applications. Covers currency formatting, culture support, min/max validation, NumberFormatInfo customization, and value binding.
npx skill4agent add syncfusion/wpf-ui-components-skills syncfusion-wpf-currency-textboxSyncfusion.Shared.WPF<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
<StackPanel Margin="20">
<!-- Basic currency input -->
<syncfusion:CurrencyTextBox
x:Name="currencyTextBox"
Width="200"
Height="30"
Value="1234.56" />
<!-- With min/max validation -->
<syncfusion:CurrencyTextBox
Width="200"
Height="30"
Value="500"
MinValue="0"
MaxValue="10000"
ScrollInterval="50" />
</StackPanel>
</Window>using Syncfusion.Windows.Shared;
// Create instance
CurrencyTextBox currencyTextBox = new CurrencyTextBox();
currencyTextBox.Width = 200;
currencyTextBox.Height = 30;
// Set value
currencyTextBox.Value = 1234.56;
// Configure validation
currencyTextBox.MinValue = 0;
currencyTextBox.MaxValue = 10000;
// Set culture for formatting
currencyTextBox.Culture = new System.Globalization.CultureInfo("en-US");
// Handle value changes
currencyTextBox.ValueChanged += (d, e) =>
{
var oldValue = e.OldValue;
var newValue = e.NewValue;
};
// Add to layout
this.Content = currencyTextBox;<syncfusion:CurrencyTextBox
x:Name="priceInput"
Width="150"
Height="30"
Value="99.99"
MinValue="0"
MaxValue="9999.99"
ScrollInterval="10"
ToolTip="Enter product price" />CurrencyTextBox currencyTextBox = new CurrencyTextBox();
currencyTextBox.Value = 1234567.89;
currencyTextBox.Culture = new CultureInfo("fr-FR"); // French formatting
// Result: 1 234 567,89 €CurrencyTextBox currencyTextBox = new CurrencyTextBox();
currencyTextBox.Value = 123456.789;
currencyTextBox.CurrencySymbol = "£";
currencyTextBox.CurrencyDecimalDigits = 2;
currencyTextBox.CurrencyGroupSeparator = ",";
currencyTextBox.CurrencyDecimalSeparator = ".";
currencyTextBox.GroupSeperatorEnabled = true;
// Result: £123,456.79<syncfusion:CurrencyTextBox
Value="{Binding Price, UpdateSourceTrigger=PropertyChanged}"
MinValue="0"
MaxValue="100000"
Width="150"
Height="30" />public class ProductViewModel : INotifyPropertyChanged
{
private double _price;
public double Price
{
get => _price;
set
{
_price = value;
OnPropertyChanged(nameof(Price));
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}<syncfusion:CurrencyTextBox
x:Name="profitLoss"
Width="150"
Height="30"
Value="-250.00"
PositiveForeground="Green"
NegativeForeground="Red"
ApplyNegativeForeground="True"
ZeroColor="Gray"
ApplyZeroColor="True" /><syncfusion:CurrencyTextBox
Width="150"
Height="30"
Value="100"
MinValue="0"
MaxValue="1000"
ScrollInterval="25"
ShowSpinButton="True" /><syncfusion:CurrencyTextBox
Width="150"
Height="30"
UseNullOption="True"
WatermarkText="Enter amount"
WatermarkTextIsVisible="True"
WatermarkTextForeground="Gray" />| Property | Type | Description |
|---|---|---|
| | Gets or sets the currency value. Use this instead of |
| | Minimum allowed value. |
| | Maximum allowed value. |
| | Culture for formatting decimal and group separators. |
| | Increment/decrement amount for arrow keys and mouse wheel. Default: 1. |
| Property | Type | Description |
|---|---|---|
| | Currency symbol to display (e.g., "$", "€", "£"). |
| | Number of decimal places. Default: -1 (culture default). |
| | Decimal separator character (e.g., ".", ","). |
| | Group separator for thousands (e.g., ",", " "). |
| | Sizes of digit groups (e.g., {3} for thousands). |
| | Enables display of group separator. |
| | Complete number format configuration object. |
| | Pattern for positive values (0-3). See formatting reference. |
| | Pattern for negative values (0-15). See formatting reference. |
| Property | Type | Description |
|---|---|---|
| | When to validate minimum: |
| | When to validate maximum: |
| | Set to MaxValue when input exceeds maximum. |
| | Set to MinValue when input is below minimum. |
| | Minimum decimal places to display. |
| | Maximum decimal places allowed. |
| | Prevents user input when true. |
| | Shows caret in read-only mode. |
| Property | Type | Description |
|---|---|---|
| | Foreground color for positive values. Default: Black. |
| | Foreground color for negative values. Default: Red. |
| | Enables negative foreground color. |
| | Foreground color when value is zero. Default: Green. |
| | Enables zero color. |
| | Background color of the control. |
| | Corner radius for rounded borders. Default: 1. |
| | Text alignment: Left, Center, or Right. |
| | Background color for selected text. |
| | Opacity of selection brush. |
| Property | Type | Description |
|---|---|---|
| | Enables mouse wheel scrolling. Default: true. |
| | Enables click-and-drag scrolling. |
| | Auto-selects text when control receives focus. Default: true. |
| Property | Type | Description |
|---|---|---|
| | Enables null value and watermark support. |
| | Value to display when control is null. |
| | Text to display when value is null/empty. |
| | Shows/hides watermark. |
| | Foreground color for watermark. |
| | Custom template for watermark appearance. |
| | Paste behavior: |
| | Shows UpDown spin buttons. |
| | Shows visual progress indicator based on min/max. |
| | Background color of range adorner. |
| Event | Description |
|---|---|
| Raised when the Value property changes. Provides OldValue and NewValue. |
ValueText