| View previous topic :: View next topic |
| Author |
Message |
mixedup Member
Joined: 05 Dec 2003 Posts: 1
|
Posted: 05/12/03 00:20 Post subject: Restricting keyboard input |
|
|
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 |
|
 |
KiteK Member
Joined: 27 Nov 2003 Posts: 6
|
Posted: 05/12/03 14:38 Post subject: Re: Restricting keyboard input |
|
|
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 |
|
 |
|