L
lyplay2
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Edit1Change(Sender: TObject);
var
i:Integer;
s:String;
begin
s:=Edit1.Text;
for i := 1 to Length(Edit1.Text) do
begin
if not (s in ['0'..'9']) then
Delete(s,i,1);
end;
Edit1.Text:=s;
end;
只能输入数据0-9,如果我想再输入小数点该如何做?
var
i:Integer;
s:String;
begin
s:=Edit1.Text;
for i := 1 to Length(Edit1.Text) do
begin
if not (s in ['0'..'9']) then
Delete(s,i,1);
end;
Edit1.Text:=s;
end;
只能输入数据0-9,如果我想再输入小数点该如何做?