5,286,006 members and growing! (20,107 online)
Email Password   helpLost your password?
Desktop Development » Edit Controls » Masked and Validating controls     Intermediate

Advanced Numeric Edit Control

By ramarez

An edit control that provides formatting and validation number
VC6, C++Windows, Win2K, WinXP, MFC, VS6, VS, Dev

Posted: 2 Dec 2001
Updated: 2 Dec 2001
Views: 64,169
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
13 votes for this Article.
Popularity: 4.73 Rating: 4.25 out of 5
1 vote, 12.5%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
2 votes, 25.0%
4
5 votes, 62.5%
5

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



Occupation: Web Developer
Location: Cuba Cuba

Other popular Edit Controls articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 16 of 16 (Total in Forum: 16) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralNegative value flawsmemberRaul Sobon20:17 19 Dec '07  
GeneralA Bug!memberAli Khanlarkhani22:10 1 Dec '07  
GeneralCreating the DLLmemberkevinlkingma3:46 22 Nov '06  
GeneralLimitText( nMax ) is invalidmemberallehiman19:19 30 May '06  
Generalcan I mention your name in my app?memberMihai Moga0:01 12 Apr '06  
GeneralRegional SettingsmemberJDonovan14:38 20 Nov '03  
GeneralRe: Regional SettingsmemberMátyásföldi Imre0:24 2 Oct '07  
GeneralError with Buddy ControlmemberJDonovan6:45 20 Nov '03  
GeneralThere is also a bug...membersoftyan1:03 8 Oct '03  
GeneralCan't Properly Set Selmemberforrest.mao18:30 28 May '03  
GeneralSuggestionmemberStlan22:12 27 Jan '03  
GeneralA bug?sussAnonymous7:59 9 Oct '02  
GeneralCreatememberAnonymous3:50 22 Feb '02  
GeneralRe: Creatememberjmarcos20:16 10 Sep '02  
GeneralMissing headermemberJohn P. Curtis20:17 3 Dec '01  
GeneralRe: Missing headermemberthierry22:30 3 Dec '01  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 2 Dec 2001
Editor: Chris Maunder
Copyright 2001 by ramarez
Everything else Copyright © CodeProject, 1999-2008
Web15 | Advertise on the Code Project