Click here to Skip to main content
Licence 
First Posted 2 Dec 2001
Views 88,680
Bookmarked 35 times

Advanced Numeric Edit Control

By | 2 Dec 2001 | Article
An edit control that provides formatting and validation number

Sample Image - XRNumericEditCtrl.jpg

Introduction

The CXrNumericEdit class is derived from the normal CEdit class.

To use this class

  • Add the CXrNumericEdit source file to project.
  • Add standard edit control
  • Change CEdit class to CXrNumericEdit
    public:
        //Dialog Data
    	//{{AFX_DATA(CNumericEditDlg)
    	enum { IDD = IDD_NUMERICEDIT_DIALOG };
    	CXrNumericEdit	m_ctrlPositiveValue;

To get and set the value in the CXrNumericEdit control use the DDX functions.

void CNumericEditDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNumericEditDlg)
    DDX_Text(pDX, IDC_POSITIVE_SAMPLE, m_dbPositiveValue);
	...
	//}}AFX_DATA_MAP
}

Thanks to

  • Randy More for 'All you ever wanted to know about the Clipboard'
  • Ian J Hart by Number, Currency, Percentage Edit Control
  • Dundas Software for the Masked Edit Control

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

ramarez

Web Developer

Cuba Cuba

Member



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
GeneralNegative value flaws PinmemberRaul Sobon19:17 19 Dec '07  
GeneralA Bug! PinmemberAli Khanlarkhani21:10 1 Dec '07  
GeneralCreating the DLL Pinmemberkevinlkingma2:46 22 Nov '06  
GeneralLimitText( nMax ) is invalid Pinmemberallehiman18:19 30 May '06  
Questioncan I mention your name in my app? PinmemberMihai Moga23:01 11 Apr '06  
GeneralRegional Settings PinmemberJDonovan13:38 20 Nov '03  
GeneralRe: Regional Settings PinmemberMátyásföldi Imre23:24 1 Oct '07  
GeneralError with Buddy Control PinmemberJDonovan5:45 20 Nov '03  
GeneralThere is also a bug... Pinmembersoftyan0:03 8 Oct '03  
GeneralCan't Properly Set Sel Pinmemberforrest.mao17:30 28 May '03  
GeneralSuggestion PinmemberStlan21:12 27 Jan '03  
QuestionA bug? PinsussAnonymous6:59 9 Oct '02  
GeneralCreate PinmemberAnonymous2:50 22 Feb '02  
GeneralRe: Create Pinmemberjmarcos19:16 10 Sep '02  
GeneralMissing header PinmemberJohn P. Curtis19:17 3 Dec '01  
GeneralRe: Missing header Pinmemberthierry21:30 3 Dec '01  

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 3 Dec 2001
Article Copyright 2001 by ramarez
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid