Cer3brus
06-04-2009, 01:55 PM
In you were wondering how to, for example, change the caption for every label on a form...
Procedure ChangeAllLabels(Caption : String)
var
K, NumberOfLables : Integer;
Begin
NumberOfLables := 0;
For K := 0 To ComponentCount - 1 Do
Begin
If Components[K] Is TLabel
Then
Begin
TLabel(Components[K]).Caption := 'I Am TLabel';
Inc(NumberOfLables);
End;//If
End;//For
ShowMessage('There Are ' + IntToStr(NumberOfLabels) + 'Labels On Your Form';
End;//Procedure
Of course, Credit to the source: http://www.festra.com/eng/snip08.htm
Procedure ChangeAllLabels(Caption : String)
var
K, NumberOfLables : Integer;
Begin
NumberOfLables := 0;
For K := 0 To ComponentCount - 1 Do
Begin
If Components[K] Is TLabel
Then
Begin
TLabel(Components[K]).Caption := 'I Am TLabel';
Inc(NumberOfLables);
End;//If
End;//For
ShowMessage('There Are ' + IntToStr(NumberOfLabels) + 'Labels On Your Form';
End;//Procedure
Of course, Credit to the source: http://www.festra.com/eng/snip08.htm