AutoSize (C++)
Description
The following code keeps the size of the label control constant, even though the length of the label�s caption changes. As a result, the caption of the label is probably too long to display in the label when you click the button.
Code
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Label1->AutoSize = false;
Label1->Caption = "This string is too long to be the caption of this label";
}
Uses
- Vcl.StdCtrls.TCustomLabel.AutoSize ( fr | de | ja )
- Vcl.Controls.TControl.Caption ( fr | de | ja )