1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| C := TControlCanvas.Create;
MonEdit := TEdit.Create(Self);
C.control := MonEdit;
with MonEdit do
begin
Parent := Form1;
Left := 10;
Top := 10;
Height := 24;
Width := 50;
Font.Style := [fsBold]; // on commente cette ligne (ou pas), ça s'adapte !
C.Font.Assign(MonEdit.Font); // peut-être pas utile ? --> NÉCESSAIRE !
//W := C.TextWidth(StringOfChar('W', MonEdit.MaxLength) );
W := C.TextWidth('Pascal Objet est le langage qu''il me faut');
ClientWidth := W + 3; // ou 4, à voir
Text := S;
end; |
Partager