?
Solved

Allow only numbers in an edit control

Posted on 1998-05-26
3
Medium Priority
?
185 Views
Last Modified: 2013-11-20
I have a edit control that I only want to accept numbers.  I have subclassed this control and captured the WM_KEYDOWN events but how do I keep the edit from displaying anything but numbers??  I used Spy++ but I didn't see any kind of paint messages sent when I typed in text.
0
Comment
Question by:dlbrown051198
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
bsimser earned 100 total points
ID: 1315108
In the resource editor, open the properties of the CEdit control you're using and check the 'numbers' checkbox. Also, create a variable of a control type via the wizard for any dialog that uses this control and set it to your subclassed version.
0
 

Author Comment

by:dlbrown051198
ID: 1315109
I do not see a "number" option under the resource editor.  Also this is a, dare I say, 16 bit app.
0
 
LVL 1

Expert Comment

by:bsimser
ID: 1315110
What version of VC are you using? I assume 4.xx but I don't have that. In 5.0 it's in the properties dialog of the control on one of the tab sheets. Not sure if it's available in 4 but it should be.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question