... Any ideas?
Unfortunately I found no good solution for that and I had to use a trick in my project: The trick is, that I place a shape under the edit!
Simply set the AutoSize of your TEdit to False, place and change the width and height of the TEdit as desired and then use the following procedure:
procedure PutShapeUnderEdit(edit: TEdit; padding: Integer);
var
bmp: TBitmap;
shape: TShape;
h: Integer;
begin
bmp := TBitmap.Create;
try
bmp.Canvas.Font.Assign(edit.Font);
h := bmp.Canvas.TextExtent('Some characters: AÄBCDEgjpqy!"$&/|,').cy;
finally
bmp.Free;
end;
shape := TShape.Create(nil);
shape.Parent := edit.Parent;
shape.Brush.Color := edit.Color;
shape.Pen.Color := edit.Font.Color;
shape.Left := edit.Left;
shape.Top := edit.Top;
shape.Width := edit.Width;
shape.Height := edit.Height;
edit.BorderStyle := bsNone;
edit.Left := edit.Left + padding;
edit.Width := edit.Width - 2 * padding;
edit.Top := edit.Top + padding + (edit.Height - h - 2 * padding) div 2;
edit.Height := h;
end;
To use it just call the procedure one time in FormCreate:
procedure TForm1.FormCreate(Sender: TObject);
begin
PutShapeUnderEdit(Edit1, 10);
end;

This works for me but you must consider other parameters in your project and do not use this code blindly, just see if the idea works for you.
By the way, I'm using VCL in Delphi 10 Seattle and Windows 10