RAD Studio VCL Reference
|
Determines whether the height of the edit control automatically resizes to accommodate the text.
property AutoSize: Boolean;
__property Boolean AutoSize;__property Boolean AutoSize;
Use AutoSize to make the edit control adjust its size automatically so the client area accommodates the height of the text. When AutoSize is false, the edit control has a fixed height. When AutoSize is true, the size of the control is readjusted whenever a change occurs that could affect the height of the control, such as a change to the font or border style.
C++ Examples:
/* This example uses an edit box and a button on a form. When the user clicks the button, the font in the edit box enlarges, and the edit box enlarges also to accommodate the larger font size. */ void __fastcall TForm1::Button1Click(TObject *Sender) { Edit1->AutoSize = true; Edit1->Font->Size = 20; Edit1->Text = "The edit box is taller now"; }
Delphi Examples:
{ { This example uses an edit box and a button on a form. When the user clicks the button, the font in the edit box enlarges, and the edit box enlarges also to accommodate the larger font size. } procedure TForm1.Button1Click(Sender: TObject); begin Edit1.AutoSize := True; Edit1.Font.Size := 20; Edit1.Text := 'The edit box is taller now'; end;
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|