procedure TForm1.edt1Change(Sender: TObject);
begin
//ShowMessage(IntToStr(GetTextLen));
end;
procedure TForm1.btn2Click(Sender: TObject);
var
a, j: Integer;
// conpent : TComponent;
begin
if lbl1.Caption = 'abHiWsdfTYADFglASDF.' then Exit;
lbl1.Caption := 'abHiWsdfTYADFglASDF.';
a := lbl1.Width;
btn1.Left := btn1.Left + (a - ss);
if (edt1.Top = btn1.Top) or (edt1.Top < (btn1.Top + btn1.Height)) or ((edt1.Height - edt1.Top) < (btn1.Top + btn1.Height)) then
if edt1.Left > btn1.Left then
begin
edt1.Left := edt1.Left + (a - ss);
end;
ShowMessage(IntToStr(Form1.Width));
if Form1.Width < (btn1.Left + btn1.Width) then
begin
Form1.Width := Form1.Width + (btn1.Left + btn1.Width - Form1.Width) + 10;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ss := lbl1.Width;
end;