Algorithm Math Delphi

Title: How to convert letters of an Editbox to uppercase
procedure TForm1.Edit1Change(Sender: TObject);
var
OldStart: Integer;
begin
with Edit1 do
if Text '' then
begin
OnChange := nil;
OldStart := SelStart;
Selstart := 0;
Sellength := 1;
Seltext := AnsiUpperCase(Text[1]);
SelStart := OldStart;
OnChange := Edit1Change;
end;
end;
To convert the fist three letters to uppercase you could write:
Selstart := 0;
SelLength := 3;
SelText := AnsiUpperCase(Copy(Text, 1, 3));