procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);
var
s: string;
c: Byte;
begin
with StringGrid1 do
s := Cells[Col, Row];
if Length(s) = 0 then
begin
if Key in ['a'..'z'] then
begin
c := Ord(Key) - 32;
Key := Chr(c);
end;
exit;
end;
if s[Length(s)] = ' ' then
if Key in ['a'..'z'] then
begin
c := Ord(Key) - 32;
Key := Chr(c);
end;
end;
|