Одной строкой
Перевод в верхний регистр первого вводимого символа
procedure TForm1.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin if (DBEdit1.SelStart = 0 ) then
Key := upCase(Key) ; end;
|
Или для Edit:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
with Sender as TEdit do
if (Text = '')
or (Text[SelStart] = ' ')
or (SelLength = Length(Text)) then
if Key in ['a'..'z'] then Key := UpCase(Key);
end;
|
[000417]