Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Masked Combo Box

Posted on 2001-06-18
3
Medium Priority
?
523 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 200 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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

664 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