🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16050

Re: simple Keypress question

#16050
From: Eudy Silva
Date: Mon, 02 Jun 2003 01:23
38 lines
1950 bytes
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: <3EDAA72F.5070708@directnet.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3edaa344@newsgroups.borland.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-01 18:30:30 PST
Message-ID: <3EDAA72F.5070708@directnet.com>
Date: Sun, 01 Jun 2003 22:23:59 -0300
From: Eudy Silva <eudy@directnet.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: simple Keypress question
References: <3edaa344@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 200.152.8.215
X-Trace: newsgroups.borland.com 1054516915 200.152.8.215 (1 Jun 2003 18:21:55 -0700)
Lines: 39
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail