<?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[Sendername existiert nicht]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab hier aus den FAQ gelesen, wie man den Sendernamen ermittelt. Dies funktioniert auch ganz gut, allerdings nicht bei Labels, die ich zur Laufzeit erzeuge. Hier mal der Code:</p>
<pre><code class="language-csharp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
TLabel *Testlabel[30];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Label1Click(TObject *Sender)
{
 Label1-&gt;Caption = dynamic_cast&lt;TLabel*&gt;(Sender)-&gt;Name;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormActivate(TObject *Sender)
{
for (int i=0; i&lt;=10; i++)
{
Testlabel[i] = new TLabel(Form1);
Testlabel[i]-&gt;Caption=&quot;Blabla&quot;;
Testlabel[i]-&gt;Width = 50;
Testlabel[i]-&gt;Left=20+i*50;
Testlabel[i]-&gt;Transparent=true;
Testlabel[i]-&gt;Top=5;
Testlabel[i]-&gt;OnClick = Label1Click;
Form1-&gt;InsertControl(Testlabel[i]);
}
}
//---------------------------------------------------------------------------
</code></pre>
<p>Hab leider keine Ahnung, wo der Fehler sein könnte.</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/122873/sendername-existiert-nicht</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 22:03:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/122873.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Oct 2005 04:34:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sendername existiert nicht on Tue, 11 Oct 2005 04:34:59 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab hier aus den FAQ gelesen, wie man den Sendernamen ermittelt. Dies funktioniert auch ganz gut, allerdings nicht bei Labels, die ich zur Laufzeit erzeuge. Hier mal der Code:</p>
<pre><code class="language-csharp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
TLabel *Testlabel[30];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Label1Click(TObject *Sender)
{
 Label1-&gt;Caption = dynamic_cast&lt;TLabel*&gt;(Sender)-&gt;Name;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormActivate(TObject *Sender)
{
for (int i=0; i&lt;=10; i++)
{
Testlabel[i] = new TLabel(Form1);
Testlabel[i]-&gt;Caption=&quot;Blabla&quot;;
Testlabel[i]-&gt;Width = 50;
Testlabel[i]-&gt;Left=20+i*50;
Testlabel[i]-&gt;Transparent=true;
Testlabel[i]-&gt;Top=5;
Testlabel[i]-&gt;OnClick = Label1Click;
Form1-&gt;InsertControl(Testlabel[i]);
}
}
//---------------------------------------------------------------------------
</code></pre>
<p>Hab leider keine Ahnung, wo der Fehler sein könnte.</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/889274</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/889274</guid><dc:creator><![CDATA[MartinN]]></dc:creator><pubDate>Tue, 11 Oct 2005 04:34:59 GMT</pubDate></item><item><title><![CDATA[Reply to Sendername existiert nicht on Tue, 11 Oct 2005 04:43:50 GMT]]></title><description><![CDATA[<p>Wahrscheinlich doch daran, dass du beim anlegen der Labels überhaupt keinen Namen vergibst. <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="😕"
    /> <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="😕"
    /> Caption ist nicht der Name, wobei du diese natürlich abfragen könntest</p>
]]></description><link>https://www.c-plusplus.net/forum/post/889276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/889276</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Tue, 11 Oct 2005 04:43:50 GMT</pubDate></item><item><title><![CDATA[Reply to Sendername existiert nicht on Tue, 11 Oct 2005 04:52:16 GMT]]></title><description><![CDATA[<p>Ist denn der Name nicht Testlabel[5] zum Beispiel?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/889280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/889280</guid><dc:creator><![CDATA[MartinN]]></dc:creator><pubDate>Tue, 11 Oct 2005 04:52:16 GMT</pubDate></item><item><title><![CDATA[Reply to Sendername existiert nicht on Tue, 11 Oct 2005 07:29:03 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>nein, <em>Testlabel[5]</em> ist der Name des Array-Elements, das auf ein Label verweist. Den (eindeutigen) Namen des Controls must du selber festlegen, z.B. so</p>
<pre><code class="language-cpp">Testlabel[i] = new TLabel(Form1);
Testlabel[i]-&gt;Name=&quot;TestLabel&quot; + IntToStr(i);
Testlabel[i]-&gt;Caption=&quot;Blabla&quot;;
...
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/889336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/889336</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 11 Oct 2005 07:29:03 GMT</pubDate></item><item><title><![CDATA[Reply to Sendername existiert nicht on Tue, 11 Oct 2005 10:25:04 GMT]]></title><description><![CDATA[<p>OK, danke für die schnelle Hilfe. Werd das gleich mal ausprobieren, wenn ich heim komme.</p>
<p>Bye</p>
]]></description><link>https://www.c-plusplus.net/forum/post/889449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/889449</guid><dc:creator><![CDATA[MartinN]]></dc:creator><pubDate>Tue, 11 Oct 2005 10:25:04 GMT</pubDate></item></channel></rss>