Vitalik Melehin mentioned this to All:
VM> Tell me plz somebody: Do have Delphi2 standart TEdit-like element,
hat
VM> work with Integer, etc. types, but not with string?
No, but it is easy to restrict a TEdit to only numbers. Just put the
following code into the TEdit's OnKeyPress handler:
procedure TForm1.Edit1KeyPress(Sender : TObject; var Key : Char);
const
BACKSPACE = #8;
begin
if not (Key in ['0'..'9', BACKSPACE]) then
Key := #0;
end;
This handler can be shared among multiple TEdit controls on the same form.
...Gary
--- GoldED 2.41
---------------
* Origin: The Flying Circus BBS, Farmington Hills, MI. (1:2410/905)
|