Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Validating Edit Controls

, 21 Mar 2004
CEdit-derived classes which validate the most popular types of data input.
validatingeditdemo.zip
res
ValidatingEditDemo.ico
temp
AMSEdit
Debug
res
AMSTest
Debug
res
ValidatingEditDemo.clw
ValidatingEditDemo.dsp
ValidatingEditDemo.dsw
ValidatingEditDemo.exe
validatingeditdemo1.zip
ValidatingEditDemo.ico
ValidatingEditDemo.clw
ValidatingEditDemo.dsp
ValidatingEditDemo.dsw
ValidatingEditDemo.exe
validatingeditdemo2.zip
ValidatingEditDemo.ico
ValidatingEditDemo.clw
ValidatingEditDemo.dsp
ValidatingEditDemo.dsw
ValidatingEditDemo.exe
validatingeditdemo3.zip
ValidatingEditDemo.ico
ValidatingEditDemo.clw
ValidatingEditDemo.dsp
ValidatingEditDemo.dsw
ValidatingEditDemo.exe
validatingeditsource.zip
validatingeditsource1.zip
validatingeditsource2.zip
validatingeditsource3.zip
// ValidatingEditDemoDlg.h : header file
//

#if !defined(AFX_VALIDATINGEDITDEMODLG_H__47C40B3E_B2C8_11D5_938E_0002A50C1C28__INCLUDED_)
#define AFX_VALIDATINGEDITDEMODLG_H__47C40B3E_B2C8_11D5_938E_0002A50C1C28__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "amsEdit.h"

/////////////////////////////////////////////////////////////////////////////
// CValidatingEditDemoDlg dialog

class CValidatingEditDemoDlg : public CDialog
{
// Construction
public:
	CValidatingEditDemoDlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CValidatingEditDemoDlg)
	enum { IDD = IDD_VALIDATING_EDIT_DEMO };
	CAMSTimeEdit	m_ctlEditTimeDataEntry;
	CSpinButtonCtrl	m_ctlSpinNumericRightDigits;
	CSpinButtonCtrl	m_ctlSpinNumericLeftDigits;
	CSpinButtonCtrl	m_ctlSpinAlphanumericMaxCharacters;
	CAMSCurrencyEdit	m_ctlEditCurrencyDataEntry;
	CAMSNumericEdit	m_ctlEditNumericDataEntry;
	CAMSMaskedEdit	m_ctlEditMaskedDataEntry;
	CAMSDateEdit	m_ctlEditDateDataEntry;
	CAMSAlphanumericEdit	m_ctlEditAlphanumericDataEntry;
	BOOL	m_bCheckNumericCannotBeNegative;
	CString	m_strEditAlphanumericInvalidCharacters;
	double	m_dEditCurrencyAsDouble;
	CString	m_strEditMaskedMask;
	int		m_nEditNumericRightDigits;
	int		m_nEditNumericLeftDigits;
	double	m_dEditNumericAsDouble;
	int		m_nEditAlphanumericMaxCharacters;
	BOOL	m_bCheckTime24HourFormat;
	BOOL	m_bCheckTimeShowSeconds;
	//}}AFX_DATA

	CDateTimeCtrl m_dateMax;
	CDateTimeCtrl m_dateMin;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CValidatingEditDemoDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CValidatingEditDemoDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnChangeEditAlphanumericInvalidCharacters();
	afx_msg void OnCheckNumericCannotBeNegative();
	afx_msg void OnChangeEditMaskedMask();
	afx_msg void OnChangeEditCurrencyDataEntry();
	afx_msg void OnChangeEditNumericDataEntry();
	afx_msg void OnChangeEditAlphanumericMaxCharacters();
	afx_msg void OnChangeEditNumericLeftDigits();
	afx_msg void OnChangeEditNumericRightDigits();
	afx_msg void OnCheckTime24HourFormat();
	afx_msg void OnCheckTimeShowSeconds();
	afx_msg void OnChangeDateRange(NMHDR *pNMHDR, LRESULT *pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_VALIDATINGEDITDEMODLG_H__47C40B3E_B2C8_11D5_938E_0002A50C1C28__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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

Share

About the Author

Alvaro Mendez
Web Developer
United States United States
I've done extensive work with C++, MFC, COM, and ATL on the Windows side. On the Web side, I've worked with VB, ASP, JavaScript, and COM+. I've also been involved with server-side Java, which includes JSP, Servlets, and EJB, and more recently with ASP.NET/C#.

| Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 22 Mar 2004
Article Copyright 2001 by Alvaro Mendez
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid