Hola elGuerrero.
Creo que podrías hacer algo así:
Código Delphi
[-]
...
type
TMiEdit = class(TEdit)
private
FAutoWidth: Boolean;
procedure SetAutoWidth(const Value: Boolean);
...
public
property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default True;
...
end;
implementation
...
procedure TMiEdit.SetAutoWidth(const Value: Boolean);
var
B: TBitMap;
begin
if (FAutoWidth <> Value) and (MaxLength <> 0) then
begin
B:= TBitMap.Create;
try
FAutoWidth:= Value;
B.Canvas.Font.Assign(Font);
Width:= B.Canvas.TextWidth(' '+Text+' ')
finally
B.Free
end;
end;
end;
...
Saludos.