![]() |
Button (variabel) Caption ändern
Hallo,
wieder mal ne Anfängerfrage. Ich habe 10 Buttons (Name: Button1, Button2, Button3 ...) Jetzt möchte ich die Caption in einer Schleife ändern. Bsp:
Code:
Geht sowas ???
var
i : integer; begin For i := 1 to 10 do begin Button[i].Caption := IntToStr[i]; end; end; Gruß DM007 |
Re: Button (variabel) Caption ändern
|
Re: Button (variabel) Caption ändern
Deine Antwort war zwar kurz, aber ich habs rausgefunden.
Delphi-Quellcode:
Danke
var
i : integer; const NamePrefix = 'Button'; begin For i := 1 to 10 do begin TButton(FindComponent(NamePrefix + IntToStr(i))).Caption := IntToStr(i); end; end; Gruß DM007 |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:29 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz