Delphi Programming

TLabel Class

2,918pages on
this wiki


Unit StdCtrls


TLabel is a delphi component reference used to display text.
Not having an interface for direct interaction with the user,the text is handled by code.

Technical CommentsEdit

(Known issues / Documentation clarifications / Things to be aware of)


Controling Labels by code.Edit

Working with a TLabel Caption,

some ways to display text in the component.

Label1.Caption := 'Hello Caption !!!';

//Give or Change its Caption

Label1.Caption := 'Hello Caption !!!' +#13+

'Second line of Caption here';

//Give or Change its Caption with multiple lines

Label1.Caption := Label2.Caption;

//Coping a Text from another Label Caption

No aditional information.

Working with a Label appearance,

some ways to change the display of the text in the component.

Label1.Font.Name := 'Arial';

//Give or Change the Text Font of its Caption

Label1.Font.Size := 12;

//Give or Change the Text Size of its Caption

Label1.Height := 40;

//Give or Change the Height of a Label

Label1.Width := 200;

//Give or Change the Width of a Label

Label1.AutoSize := TRUE;

Label1.AutoSize := FALSE;

//To set the AutoSize feature of a Label

Label1.WordWrap := TRUE;

Label1.WordWrap := FALSE;

//To set the WordWrap feature of a Label

Label1.Color := clBlue;

Label1.Color := $00FF8000;

//Change Background color of a Label

Label1.Font.Color := clYellow;

Label1.Font.Color := $00808040;

//Change Background color of a Label

No aditional information.

See AlsoEdit

(Please provide links to items specifically related to this item.)

User Comments/TipsEdit

Around Wikia's network

Random Wiki