Solved

Masked Combo Box

Posted on 2001-06-18
3
519 Views
Last Modified: 2013-11-20
My requirement ins simple .. but I just dunno how to get this done. All I need is a Mask Combo Box. ie. I have a DropDownList (style) combo box. So I let users select from its list or type a value. But I want to restrict a few characters from getting typed.
I thought of having my MaskCombo class overriding PreTranslateMessage. I can trap the key and if it is one of the restricted chars I can return ZERO. But since I need only a few valid chars., I'd have to put in a whole lot of things to restrict. I dont want to do this.
Let me put this in simpler words. How do I restrict the user input to just Numbers, "-" and A to Z (Caps) ONLY !
0
Comment
Question by:sri_darr
[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
3 Comments
 
LVL 12

Accepted Solution

by:
migel earned 50 total points
ID: 6202645
Hi!
you need to subclass Edit control of the ComboBox
how to achieve this look at MSDN
"HOWTO: Subclass CListBox and CEdit Inside of CComboBox"
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 6202904
migel: why can't he create CListBox derive class and manipulate the key down in windowProc?
0
 
LVL 4

Author Comment

by:sri_darr
ID: 6203194
Thanks migel.... With that article and a li'l bit of trial codes I was able to acheive this. The right direction is what I needed. Thanks again.

PS: I searched on this "Subclass AND ComboBox" and I cant believe I missed this topic in that whole list.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

710 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