Solved

Masked Combo Box

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
if loop error 4 77
iSeries DB2 Query 2 84
has22 challenge 11 72
matchUp  challenge 9 72
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.
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.
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

20 Experts available now in Live!

Get 1:1 Help Now