Skip to content

mtusk/wpf-currency-textbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Currency TextBox

A WPF TextBox for entering a currency value, similar to how a cash register works.

example

Features

  • Numbers typed are pushed in from the right. If we start with the default value 0.00, and start typing the numbers 123, the value updates as such: 0.00 => 0.01 => 0.12 => 1.23
  • If we press the backspace key, the numbers are shifted right: 1.23 => 0.12 => 0.01 => 0.00
  • If we press the delete key, the value is reset to 0.00.
  • If we press the minus key, the value becomes negative.
  • Copy and paste are disabled (both via context menu and keyboard shortcuts)
  • This control's template can be customized to change the appearance.
  • Supports data validation.

How to use

Add a reference to CurrencyTextBoxControl.dll from your project, then add the following namespace to your XAML:

xmlns:currency="clr-namespace:CurrencyTextBoxControl;assembly=CurrencyTextBoxControl"

Insert the control like this:

<currency:CurrencyTextBox Number="{Binding Number}" />

About

A WPF TextBox for entering a currency value

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages