TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Administrator
Tech Writer
2.2k
1.5m
Combobox KeyPress Event
Apr 15 2003 12:31 PM
I have been looking around the Internet in hopes to find a way to restrict certian keys from being accepeted from a combobox control... I found an article that explains using the KeyPress Event and setting the KeyPressEventArg.Handled property to true. I thought is was heaven until I tried it... On a combobox I could not get it to restrict the keystrokes but when I past the exact same code into a textbox's Keypress event it worked like a charm. N E IDEAS. The following will not restrict numeric values from being entered private void CombopBox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if ( char.IsDigit ( e.KeyChar ) ) e.Handled = true; } the following does restrict numeric values from being entered private void TextBox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if ( char.IsDigit ( e.KeyChar ) ) e.Handled = true; } I don't get it? Jim Di Crescenzo
Reply
Answers (
1
)
Passing data between MDI-children
tab control