Posted by Marc M on March 12, 2008
I'm new to Delphi (1 week) and I must say it is great! procedure TForm2.bSwClick(Sender: TObject);
var e: TButton;
i: integer;
begin
e := Sender as TButton;
for i := 0 to componentcount - 1 do
begin
if components[i] is TLabel then
if components[i].tag = e.tag then
if Tlabel(components[i]).Font.Color = clBlack then
Tlabel(components[i]).Font.Color := clRed
else
begin
Tlabel(components[i]).Font.Color := clBlack;
end;
begin
if components[i] is TShape then
if Tshape(components[i]).tag = e.tag then
Tshape(components[i]).Visible := not (Tshape(components[i]).Visible);
end;
end;
end;
Related articles
Follow Ups
Post a Followup
DelphiLand Club members: enter your Membership password.
Guests can get a Forum Guest password by subscribing to the DelphiLand Newsletter.