65.9K
CodeProject is changing. Read more.
Home

Yet Another Custom Currency Box

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.85/5 (14 votes)

Nov 26, 2006

CPOL
viewsIcon

55794

downloadIcon

1133

Control that only allows numeric inputs

Sample Image - CurrencyBox.gif

Introduction

Trying to make my first custom control, I decided to build a textbox that will only allow numeric inputs. So I searched on the internet and found a very good control (NumericBox). I try to reproduce it to include it in my new personal custom controls library.

Help

  1. Use "," or "." to put the cursor before or after a decimal separator.
  2. "-" if enabled negative numbers add a minus sign.
  3. "+" Convert negative number to positive.
  4. BackSpace, erase the integer part of the number.
  5. Del, erase the decimal part of the number.

Thanks to

  • ProSoft for the great idea

Update

  • 24/05/2009: Enhancement
    • Added MaxValue and MinValue properties
    • Added ShowThousand separator property
  • 28/01/2007: Fixed Bugs
    • Deleting a number with backspace, the control eliminates two numbers