Solved

Masked Combo Box

Posted on 2001-06-18
3
515 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now