Avatar of troehm
troehm

asked on 

How can I cancel a cancel a key from being pressed in one of my textboxes in vb6?

Hi everyone,

What i'm trying to do here is basically only allow upper and lowercase letters to be entered into a textbox on my form. In the keypress event I can detect what I need fine, but how do I go about not letting that key through if it isn't a letter. I've been reading that I need to do something with the KeyEventArgs.Handled property in the System.Windows.Forms.dll? I've been reading and reading on MSDN and other sites and I just can't seem to figure this out. I need some help! Thanks guys
Visual Basic Classic

Avatar of undefined
Last Comment
troehm
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
"I've been reading that I need to do something with the KeyEventArgs.Handled property in the System.Windows.Forms.dll?"

The code you have been reading about is intended for a VB.NET application (which can be quite different from VB6 code as jpaulino has shown...)!!!
Avatar of troehm
troehm

ASKER

Thanks
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo