Autor Beitrag
jrn
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Do 27.05.04 13:07 
Hi! ive got one question:

is it possible to fill buttons' names in some loop:

Button01.Caption := '1'
Button02.Caption := '2'
.
.
.
Button0N.Caption := 'N'

it is possible i.e. in actionscript, but what about delphi?

thanks in advance

Moderiert von user profile iconMotzi: Topic Verschoben


Zuletzt bearbeitet von jrn am Do 27.05.04 16:28, insgesamt 1-mal bearbeitet
FaTaLGuiLLoTiNe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 200
Erhaltene Danke: 5

Windows 7, Windows 8.1
Delphi XE
BeitragVerfasst: Do 27.05.04 13:14 
It is possible, but a little more complicated :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
var i, x: Integer;

For i := 1 to x
 do TButton(FindComponent('Button' + IntToStr(i)).Caption := IntToStr(i);

_________________
<< FaTaLGuiLLoTiNe >>
Rhinoceroses don't play games!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 27.05.04 16:07 
Hi and Welcome!

Please edit your topic's title! In the moment it doesn't contain any information about the problem itself and that's bad when people search in our database for solutions of their problems.

To change the title, you only have to use the "edit"-button in your first posting!

Thank you!
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".