<?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[Label - Tag Probleme]]></title><description><![CDATA[<p>Hallo,<br />
mit folgender Routine möchte ich die Feldnamen einer Tabelle übergeben. Obwohl ich Tag-Werte korrekt eingerichtet habe, werden diese nicht erkannt. Wer sagt mir, wo der Fehler liegt, bzw.was ich falsch mache.<br />
Danke schon jetzt für eure Hilfe.<br />
Gruß Egbert</p>
<pre><code class="language-cpp">void __fastcall TFKDB::TabKopfInDsAnzeige(TObject *Sender,TStringGrid *Grid)
{
   String s = &quot;...............&quot;;

   String str;
   for (int x=1; x&lt;20; x++)
   {
     str = Grid-&gt;Cells[x][0]+s;
     if ( ((TLabel *)Sender)-&gt;Tag  == x )
     {
       ((TLabel *)Sender)-&gt;Caption = str.SubString(1,15)+&quot; :&quot;;
     }
   }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/106130/label-tag-probleme</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 15:44:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/106130.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Apr 2005 11:28:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Label - Tag Probleme on Wed, 06 Apr 2005 11:28:27 GMT]]></title><description><![CDATA[<p>Hallo,<br />
mit folgender Routine möchte ich die Feldnamen einer Tabelle übergeben. Obwohl ich Tag-Werte korrekt eingerichtet habe, werden diese nicht erkannt. Wer sagt mir, wo der Fehler liegt, bzw.was ich falsch mache.<br />
Danke schon jetzt für eure Hilfe.<br />
Gruß Egbert</p>
<pre><code class="language-cpp">void __fastcall TFKDB::TabKopfInDsAnzeige(TObject *Sender,TStringGrid *Grid)
{
   String s = &quot;...............&quot;;

   String str;
   for (int x=1; x&lt;20; x++)
   {
     str = Grid-&gt;Cells[x][0]+s;
     if ( ((TLabel *)Sender)-&gt;Tag  == x )
     {
       ((TLabel *)Sender)-&gt;Caption = str.SubString(1,15)+&quot; :&quot;;
     }
   }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/760993</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/760993</guid><dc:creator><![CDATA[Egbert]]></dc:creator><pubDate>Wed, 06 Apr 2005 11:28:27 GMT</pubDate></item><item><title><![CDATA[Reply to Label - Tag Probleme on Wed, 06 Apr 2005 11:45:03 GMT]]></title><description><![CDATA[<p>ist den die übergabe vom &quot;TObject *Sender&quot; korrekt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/761005</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/761005</guid><dc:creator><![CDATA[BigNeal]]></dc:creator><pubDate>Wed, 06 Apr 2005 11:45:03 GMT</pubDate></item><item><title><![CDATA[Reply to Label - Tag Probleme on Wed, 06 Apr 2005 11:45:09 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>aus dem geposteten Code läßt sich kein Problem erkennen. Debugge doch mal und las dir die Werte von *((TLabel <em>)Sender)-&gt;Tag</em> und <em>x</em> anzeigen.<br />
Außerdem solltest du statt den C-Style Casts lieber <em>static_cast</em> verwenden.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/761007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/761007</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 06 Apr 2005 11:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to Label - Tag Probleme on Wed, 06 Apr 2005 12:39:13 GMT]]></title><description><![CDATA[<p>Hallo,<br />
danke für die prompten Antworten. Möglicherweise war &quot;TObject *Sender&quot; die Ursache, denn der Aufruf erfolgte aus dem Formular heraus.<br />
Habe jetzt die Routine folgendermaßen umgestellt.</p>
<pre><code class="language-cpp">void __fastcall TFKDB::TabKopfInDsAnzeige(TStringGrid *Grid)
{
   String s = &quot;...............&quot;;
   TLabel *myLabel;

   String str;
   for (int x=1; x&lt;21; x++)
   {
     str = Grid-&gt;Cells[x][0]+s;
     myLabel=dynamic_cast&lt;TLabel*&gt;(FindComponent(&quot;Label&quot;+IntToStr(x)));
     myLabel-&gt;Caption = str.SubString(1,15)+&quot;:&quot;;
   }
}
//-------------------------------------------------------------------------
</code></pre>
<p>jetzt klappt es so, wie gewollt.<br />
Danke und Gruß Egbert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/761064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/761064</guid><dc:creator><![CDATA[Egbert]]></dc:creator><pubDate>Wed, 06 Apr 2005 12:39:13 GMT</pubDate></item></channel></rss>