Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Caption zuweisung abkürzen (https://www.delphipraxis.net/95129-caption-zuweisung-abkuerzen.html)

DenSchub 1. Jul 2007 18:48


Caption zuweisung abkürzen
 
Hallo.

Ich habe mal ne Frage. In einem Programm muss ich 20 Zufallszahlen erstellen und sie einem Label zuweisen.
Also habe ich es einfach so gemacht:
Delphi-Quellcode:
  Label1.Caption := IntToStr(Random(10000000000));
  Label2.Caption := IntToStr(Random(10000000000));
  Label3.Caption := IntToStr(Random(10000000000));
  Label4.Caption := IntToStr(Random(10000000000));
  Label5.Caption := IntToStr(Random(10000000000));
  Label6.Caption := IntToStr(Random(10000000000));
  Label7.Caption := IntToStr(Random(10000000000));
  Label8.Caption := IntToStr(Random(10000000000));
  Label9.Caption := IntToStr(Random(10000000000));
  Label10.Caption := IntToStr(Random(10000000000));
  Label11.Caption := IntToStr(Random(10000000000));
  Label12.Caption := IntToStr(Random(10000000000));
  Label13.Caption := IntToStr(Random(10000000000));
  Label14.Caption := IntToStr(Random(10000000000));
  Label15.Caption := IntToStr(Random(10000000000));
  Label16.Caption := IntToStr(Random(10000000000));
  Label17.Caption := IntToStr(Random(10000000000));
  Label18.Caption := IntToStr(Random(10000000000));
  Label19.Caption := IntToStr(Random(10000000000));
  Label20.Caption := IntToStr(Random(10000000000));
Geht das auch kürzer?

Dennis

KLS 1. Jul 2007 18:53

Re: Caption zuweisung abkürzen
 
Ja, es geht kürzer.

Schau dir mal findcomponent an.

DenSchub 1. Jul 2007 18:57

Re: Caption zuweisung abkürzen
 
Danke :thumb:
Sowas habe ich gesucht.

Dennis


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:27 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 by Thomas Breitkreuz