Советы по Delphi

         

Перевод в верхний регистр первого вводимого символа


procedure TForm1.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin
if
(DBEdit1.SelStart = 0 ) thenKey := upCase(Key) ; end;

Или для Edit:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);beginwith Sender as TEdit doif (Text = '')or (Text[SelStart] = ' ')or (SelLength = Length(Text)) thenif Key in ['a'..'z'] then Key := UpCase(Key);end;

[000417]



Содержание раздела