DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Restricting keyboard input

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
mixedup
Member


Joined: 05 Dec 2003
Posts: 1

PostPosted: 05/12/03 00:20    Post subject: Restricting keyboard input Reply with quote

Hello,

I need to restrict keyboard input to numbers only - am writing a small converter app- and haven't hit on anything that works completely. Please help . . . . .
Back to top
View user's profile
KiteK
Member


Joined: 27 Nov 2003
Posts: 6

PostPosted: 05/12/03 14:38    Post subject: Re: Restricting keyboard input Reply with quote

Hi! Do you want code for console, or normal? If normal, and You use TEdit, write this in OnKeyPress:

Code:

if not(Key in ['0'..'9']) then
begin
  Beep;
  Key := #0;
end;
Back to top
View user's profile Yahoo Messenger
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group