Topic: The use of arrays

Hi Dmitry,

Is it possible to use an array to change the caption of say 31 labels on a form. I'm trying to design a service application for trucks so when the user picks a month from a month calendar that month's days are displayed in a calendar type format on the form along with trucks requiring service. Also, is the use of images the only way in MVD to have lines and squares on a form. Thank you for your advice.

Terry

Re: The use of arrays

Hello,



Example, how to get all Labels on form and change caption of them

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    i,c: integer;
begin
    c := Form1.ComponentCount-1;
    for i := 0 to c do
    begin
        if Form1.Components[i] is TLabel then TLabel(Form1.Components[i]).Caption := 'Hello';
    end;
end;
Dmitry.