Click here to Skip to main content
Licence CPOL
First Posted 26 Nov 2006
Views 29,636
Downloads 567
Bookmarked 23 times

Yet Another Custom Currency Box

By | 23 May 2009 | Article
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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Juan Manuel Elosegui

Software Developer

Spain Spain

Member

Graduado de Ingenieria Mecánica en la Cujae (2001),
Universidad de la Habana, Cuba

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionSelect text on got focus event PinmemberMCAST765:42 10 Dec '11  
GeneralI have Convert this Code Into VB but it doesn't work can u help me??? PinmemberSunLucDong21:13 16 Apr '11  
GeneralHindi Numbers PinmemberPeaceTiger10:22 6 Nov '10  
GeneralRe: Hindi Numbers PinmemberPeaceTiger21:03 6 Dec '10  
GeneralMy vote of 5 PinmemberPeaceTiger15:25 15 Oct '10  
GeneralNice control but i experienced some weird issues PinmemberMember 25738316:35 7 Jan '10  
GeneralMnemonics issue Pinmembereric marin5:02 15 Oct '09  
GeneralPocket PC project PinmemberPGuimaraes4:07 3 Sep '08  
GeneralThanks PinmemberDALAS_<><>23:11 14 Jun '07  
GeneralChange to to control Pinmemberhardsoft9:54 14 Jun '07  
GeneralBut it's in C# Code not C++ PinmemberNacereddine1:20 29 Jan '07  
GeneralThank you! PinmemberMCAST767:12 26 Jan '07  
GeneralRe: Thank you! PinmemberJuan Manuel Elosegui4:12 28 Jan '07  
GeneralRe: Thank you! PinmemberMCAST7613:52 28 Jan '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 23 May 2009
Article Copyright 2006 by Juan Manuel Elosegui
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid