
16.01.2010, 10:44
|
Прохожий
|
|
Регистрация: 06.01.2010
Сообщения: 26
Репутация: 10
|
|
отрывок кода...
Код:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
case Key of
'0' .. '9', #8 : ; // цифры и клавиша <Backspace>#13: Form1.Edit2.SetFocus; // клавиша <Enter>'.' ,'.' :
begin
if Key = '.'
then Key:=', if Pos(',',Edit1.Text) <> 0
then Key:= Chr(0);
end;
else // все остальные символы запрещены
Key := Chr(0);
end;
end;
|