<?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[Ereignisbehandlungsroutine für dynamisch angelegte Komponenten schreiben ?]]></title><description><![CDATA[<p>Hallo</p>
<p>In meinem Programm will ich einige TCheckBox-Komponenten dynamisch anlegen.</p>
<p>Dazu habe ich folgenden Code in im FAQ gefunden:</p>
<pre><code class="language-cpp">DynamicArray&lt;TLabel*&gt;LblArray; 
int LblNum = 5; 
//--------------------------------------------------------------------------- 
__fastcall TForm1::TForm1(TComponent* Owner) 
  : TForm(Owner) 
{   
  LblArray.Length = LblNum; 
  for (int i = 0; i &lt; LblArray.Length; i++) 
    LblArray[i] = new TLabel(this); 
} 
//--------------------------------------------------------------------------- 
void __fastcall TForm1::Button1Click(TObject *Sender) 
{ 
  for (int i = 0; i &lt; LblArray.Length; i++) 
  { 
    LblArray[i]-&gt;Parent = this; 
    LblArray[i]-&gt;Caption = &quot;Label&quot; + String(i+1); 
    LblArray[i]-&gt;Top = 20 * i; 
    LblArray[i]-&gt;Show(); 
  } 
}
</code></pre>
<p>Logischerweise konnte ich ja den Code nicht 1 zu 1 übernehmen und musste ihn etwas anpassen.<br />
Also das dynamische anlegen klappt bisher auch ganz gut, nur würde ich jetzt gerne wissen, wie und wo ich eine Ereignisbehandlungsroutine zu einer bestimmten Komponente in dem Array schreiben kann ? Genauer gesagt beim Ereignis &quot;OnClick&quot;.</p>
<p>Vielen Dank für eure Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/82311/ereignisbehandlungsroutine-für-dynamisch-angelegte-komponenten-schreiben</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 04:33:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/82311.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Aug 2004 09:46:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ereignisbehandlungsroutine für dynamisch angelegte Komponenten schreiben ? on Tue, 10 Aug 2004 09:49:30 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>In meinem Programm will ich einige TCheckBox-Komponenten dynamisch anlegen.</p>
<p>Dazu habe ich folgenden Code in im FAQ gefunden:</p>
<pre><code class="language-cpp">DynamicArray&lt;TLabel*&gt;LblArray; 
int LblNum = 5; 
//--------------------------------------------------------------------------- 
__fastcall TForm1::TForm1(TComponent* Owner) 
  : TForm(Owner) 
{   
  LblArray.Length = LblNum; 
  for (int i = 0; i &lt; LblArray.Length; i++) 
    LblArray[i] = new TLabel(this); 
} 
//--------------------------------------------------------------------------- 
void __fastcall TForm1::Button1Click(TObject *Sender) 
{ 
  for (int i = 0; i &lt; LblArray.Length; i++) 
  { 
    LblArray[i]-&gt;Parent = this; 
    LblArray[i]-&gt;Caption = &quot;Label&quot; + String(i+1); 
    LblArray[i]-&gt;Top = 20 * i; 
    LblArray[i]-&gt;Show(); 
  } 
}
</code></pre>
<p>Logischerweise konnte ich ja den Code nicht 1 zu 1 übernehmen und musste ihn etwas anpassen.<br />
Also das dynamische anlegen klappt bisher auch ganz gut, nur würde ich jetzt gerne wissen, wie und wo ich eine Ereignisbehandlungsroutine zu einer bestimmten Komponente in dem Array schreiben kann ? Genauer gesagt beim Ereignis &quot;OnClick&quot;.</p>
<p>Vielen Dank für eure Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/578841</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/578841</guid><dc:creator><![CDATA[GaZmo]]></dc:creator><pubDate>Tue, 10 Aug 2004 09:49:30 GMT</pubDate></item><item><title><![CDATA[Reply to Ereignisbehandlungsroutine für dynamisch angelegte Komponenten schreiben ? on Tue, 10 Aug 2004 09:53:54 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>schau in die FAQ (da wird das beschrieben)<br />
(unter Komponenten dynamisch erzeugen oder so)</p>
<p>MfG<br />
Klaus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/578848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/578848</guid><dc:creator><![CDATA[KlausB]]></dc:creator><pubDate>Tue, 10 Aug 2004 09:53:54 GMT</pubDate></item><item><title><![CDATA[Reply to Ereignisbehandlungsroutine für dynamisch angelegte Komponenten schreiben ? on Wed, 11 Aug 2004 10:44:00 GMT]]></title><description><![CDATA[<p>Vielen Dank <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/579795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/579795</guid><dc:creator><![CDATA[GaZmo]]></dc:creator><pubDate>Wed, 11 Aug 2004 10:44:00 GMT</pubDate></item></channel></rss>