Свойства edit ?
Добавлено: 10 авг 2004, 21:32
Вот столкнулся с проблемой, нужно чтобы в edit можно было вводить цифры 0-9, буквы a-f и все как это реализовать ?
Код: Выделить всё
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key in [#8,'0'..'9','a'..'f'] then Key:=System.UpCase(Key) else Key:=#0;
end;
Код: Выделить всё
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
label m1;
var col:dword;
begin
col:=ord(key);
If col < $30 then begin
If (col=$8) or (col=$20) or (col=$3) then goto m1 else
Key := #0;
end else;
If col > $66 then Key := #0 else
If col > $46 then begin
If col <$61 then Key := #0 else
end else;
If col > $39 then begin
If col < $41 then Key := #0 else
end else;
m1:
end;
end.
Код: Выделить всё
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key in [#8,#20,#3,'0'..'9','a'..'f'] then Key:=System.UpCase(Key) else Key:=#0;
end;
end.