Click here to Skip to main content
6,596,602 members and growing! (20,367 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
VC6Win2K, WinXP, MFC, Dev
Posted:2 Dec 2001
Views:73,762
Bookmarked:28 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
13 votes for this article.
Popularity: 4.73 Rating: 4.25 out of 5
1 vote, 12.5%
1

2

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


Member

Occupation: Web Developer
Location: Cuba Cuba

Other popular Edit Controls articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 16 of 16 (Total in Forum: 16) (Refresh)FirstPrevNext
GeneralNegative value flaws PinmemberRaul Sobon20:17 19 Dec '07  
GeneralA Bug! PinmemberAli Khanlarkhani22:10 1 Dec '07  
GeneralCreating the DLL Pinmemberkevinlkingma3:46 22 Nov '06  
GeneralLimitText( nMax ) is invalid Pinmemberallehiman19:19 30 May '06  
Generalcan I mention your name in my app? PinmemberMihai Moga0:01 12 Apr '06  
GeneralRegional Settings PinmemberJDonovan14:38 20 Nov '03  
GeneralRe: Regional Settings PinmemberMátyásföldi Imre0:24 2 Oct '07  
GeneralError with Buddy Control PinmemberJDonovan6:45 20 Nov '03  
GeneralThere is also a bug... Pinmembersoftyan1:03 8 Oct '03  
GeneralCan't Properly Set Sel Pinmemberforrest.mao18:30 28 May '03  
GeneralSuggestion PinmemberStlan22:12 27 Jan '03  
GeneralA bug? PinsussAnonymous7:59 9 Oct '02  
GeneralCreate PinmemberAnonymous3:50 22 Feb '02  
GeneralRe: Create Pinmemberjmarcos20:16 10 Sep '02  
GeneralMissing header PinmemberJohn P. Curtis20:17 3 Dec '01  
GeneralRe: Missing header Pinmemberthierry22: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-2009
Web21 | Advertise on the Code Project