Einzelnen Beitrag anzeigen

Benutzerbild von Dani
Dani

Registriert seit: 19. Jan 2003
732 Beiträge
 
Turbo Delphi für Win32
 
#2

Re: Schleife mit variablen Komponentennamen?

  Alt 15. Aug 2004, 14:25
Hi,

Delphi-Quellcode:
var
 i: Integer;
 cBox: TComponent;
begin
 for i:=0 to 10 do
  begin
   cBox := Form1.FindComponent('ComboBox'+IntToStr(i));
   If cBox <> nil then
    (cBox as TComboBox).ItemIndex := 0;
  end;
end;
Dani H.
  Mit Zitat antworten Zitat