2009. október 4., vasárnap

Access components by their name property


Problem/Question/Abstract:

How to access components by their name property

Answer:

The following example uses the FindComponent method of Form1 to disable the first 10 SpeedButtons by name:

for i := 1 to 10 do
  with Form1.FindComponent('SpeedButton' + IntToStr(i)) as TSpeedButton do
    Enabled := False;

Nincsenek megjegyzések:

Megjegyzés küldése