<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Labels Durchnummerieren]]></title><description><![CDATA[<p>Hi,<br />
ist es möglich das ich z.B. 10 labels mit ner for schleife beschriften kann? ohne das ich jedes einzelene aufrufen muss? mit so ner Art Array?</p>
<p>Zur Zeit sieht das bei mir so aus</p>
<pre><code class="language-cpp">label1-&gt;Caption=1;
label2-&gt;Caption=2;
label2-&gt;Caption=3;
usw.
</code></pre>
<p>Gibt es nicht ne möglichkeit das in etwa so zu machen?</p>
<pre><code class="language-cpp">for(int i=0,i&lt;10,i++)
    label[i]-&gt;Caption=i;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/147152/labels-durchnummerieren</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 01:16:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147152.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 May 2006 16:26:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Labels Durchnummerieren on Sun, 14 May 2006 16:26:23 GMT]]></title><description><![CDATA[<p>Hi,<br />
ist es möglich das ich z.B. 10 labels mit ner for schleife beschriften kann? ohne das ich jedes einzelene aufrufen muss? mit so ner Art Array?</p>
<p>Zur Zeit sieht das bei mir so aus</p>
<pre><code class="language-cpp">label1-&gt;Caption=1;
label2-&gt;Caption=2;
label2-&gt;Caption=3;
usw.
</code></pre>
<p>Gibt es nicht ne möglichkeit das in etwa so zu machen?</p>
<pre><code class="language-cpp">for(int i=0,i&lt;10,i++)
    label[i]-&gt;Caption=i;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1057650</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057650</guid><dc:creator><![CDATA[InderLernPhase]]></dc:creator><pubDate>Sun, 14 May 2006 16:26:23 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Sun, 14 May 2006 16:39:11 GMT]]></title><description><![CDATA[<p>Siehe <a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39305" rel="nofollow">FAQ</a>, &quot;Komponenten zur Laufzeit erstellen&quot; usw.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057666</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057666</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 14 May 2006 16:39:11 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Sun, 14 May 2006 17:06:13 GMT]]></title><description><![CDATA[<p>Hm.. Also ich hab da jetzt nichts gefunden was mir jetzt nützlich sein könnte. Ich will ja keine Labels erstellen, sondern Exestierende Labels wärend der Laufzeit beschrift.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057686</guid><dc:creator><![CDATA[InderLernPhase]]></dc:creator><pubDate>Sun, 14 May 2006 17:06:13 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Sun, 14 May 2006 17:42:07 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das Prinzip ist das selbe. Du must eben in Konstruktor des Frames die bereits existierenden Labels in das Array schreiben.<br />
Danach kannst du belibig oft iterierend auf das Array mit den labels zugreifen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057704</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 14 May 2006 17:42:07 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Sun, 14 May 2006 18:44:15 GMT]]></title><description><![CDATA[<p>Wärst du denn so freundlich mir ein kleines bespiel mal zu tippen? irgenwie raff ich das nicht so ganz. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057742</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057742</guid><dc:creator><![CDATA[InderLernPhase]]></dc:creator><pubDate>Sun, 14 May 2006 18:44:15 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Sun, 14 May 2006 20:36:05 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>in der Header-Datei des Forms das Array deklarieren</p>
<pre><code class="language-cpp">...
  private :   
    ...

    const int labelcount = 3; // Feste Anzahl der betreffenden Labels
    TLabel* labels[labelcount]; // Array mit Label-Pointern
  public :
    ...
</code></pre>
<p>Dann im Konstruktor das Array füllen</p>
<pre><code class="language-cpp">void __fastcall TForm1::TForm1(TObject* Sender)
{
  labels[0] = Label1; // Erstes Label als erstes Element in Array eintragen
  labels[1] = Label2; // Zweites Label als zweites Element in Array eintragen
  ...
  labels[2] = Label3; // Letztes Label als letztes Element in Array eintragen
}
</code></pre>
<p>Dann kannst du zur Laufzeit in den methoden des Forms jederzeit über das Array iterieren</p>
<pre><code class="language-cpp">...
  for (int lv = 0; lv &lt; labelcount; ++lv)
  {
    labels[lv]-&gt;Caption = &quot;Label &quot; + IntToStr(lv)
  }
  ...
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057802</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 14 May 2006 20:36:05 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Mon, 15 May 2006 08:59:57 GMT]]></title><description><![CDATA[<p>Du kannst aber auch</p>
<pre><code class="language-cpp">TLabel *label = (TLabel*)FindComponent(&quot;label&quot;+IntToStr(nr));
if(label)
   label-&gt;Caption = &quot;text&quot;+IntToStr(nr);
</code></pre>
<p>verwenden.</p>
<p>Aber professioneller ist schon die von akari gezeigte Methode,<br />
wobei es noch besser wäre, wenn die Labels dann auch gleich zur Laufzeit erzeugt werden (anstatt der Einzelzuweisung - bei 10 geht's ja noch, aber bei größerer Anzahl ???)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057943</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057943</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Mon, 15 May 2006 08:59:57 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Mon, 15 May 2006 14:34:32 GMT]]></title><description><![CDATA[<p>Das mit den 10 war nur ein beispiel es sind eigenlich über 240. und da ist es etwas mühselig jedes einzelene in array abzulegen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058223</guid><dc:creator><![CDATA[InderLernPhase]]></dc:creator><pubDate>Mon, 15 May 2006 14:34:32 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Mon, 15 May 2006 14:36:15 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>deshalb ist es ja auch besser, alle so betroffenen Labels dynamisch (ebenfalls in einer Schleife) anzulegen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058226</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 15 May 2006 14:36:15 GMT</pubDate></item><item><title><![CDATA[Reply to Labels Durchnummerieren on Mon, 15 May 2006 20:27:28 GMT]]></title><description><![CDATA[<p>Je nach gewünschtem Layout können die erforderlichen, u.U. mehrfach verschachtelten Schleifen aber schon mal recht komplex werden, ausserdem läuft es eigentlich dem RAD- bzw. WYSIWYG-Gedanken der Oberflächenentwicklung im BCB zuwider.</p>
<p>Deshalb empfiehlt es sich ggf., die Controls wie gewohnt zur Entwurfszeit von Hand anzuordnen und dann beim Programmstart in ein entsprechendes Array einzulesen. Den Ansatz dazu findest du in den FAQ-Beiträgen &quot;Zugriff, aber nicht durch Namen&quot; und &quot;dynamische Arrays&quot; im Abschnitt &quot;Komponenten benutzen&quot; (das bereits erwähnte 'usw').</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058481</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Mon, 15 May 2006 20:27:28 GMT</pubDate></item></channel></rss>