Article View: borland.public.cppbuilder.nativeapi
Article #16068Re: simple Keypress question
From: Mark Guerrieri
Date: Mon, 02 Jun 2003 19:44
Date: Mon, 02 Jun 2003 19:44
47 lines
2208 bytes
2208 bytes
Or use a TMaskEdit...
Mark
"Eudy Silva" <eudy@directnet.com> wrote in message
news:3EDAA72F.5070708@directnet.com...
> Hi micheal,
>
> You're using the correct value, VK_SPACE.
> I don't know why it doesn't work with the
> keydown event for the Edit. Someone else
> might clarify this for us both.
>
> But your code works if you use the edit's
> keypress event.
>
> Note, though, that only intercepting the
> keypress event might not be enough to achieve
> your goal. The user still might paste characters
> containing a white space in the edit field...
>
> Maybe you can use the OnChange event and strip out
> any unwanted characters.
>
> Eudy
>
>
> micheal davis wrote:
> > Hi all,
> >
> > I've an TEdit control that I want to avoid users entering spaces in it,
so I
> > want to disable the key press of the space bar in the TEdit control
> >
> > I've tried VK_SPACE under keydown event although it didn't work,
> > if(Key==VK_SPACE)
> > { Key=0;
> > }
> > so does anyone know what is the number for the space bar in order to use
it
> > under the keypress event.
> >
> > thanks a lot for your help and support
> >
> >
> >
>
Technical Details
Message-ID:
<3edba8b8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3edaa344@newsgroups.borland.com> <3EDAA72F.5070708@directnet.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d03b79cb5ee12d8a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-02 12:48:04 PST Reply-To: "Mark Guerrieri" <mguerrieri@cmsgrp.com> From: "Mark Guerrieri" <mguerrieri@cmsgrp.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3edaa344@newsgroups.borland.com> <3EDAA72F.5070708@directnet.com> Subject: Re: simple Keypress question Date: Mon, 2 Jun 2003 15:44:57 -0400 Lines: 49 Organization: Creative Marketing Strategies X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 66.200.143.50 Message-ID: <3edba8b8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054582968 66.200.143.50 (2 Jun 2003 12:42:48 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail