<?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[CheckListBox Eintrag löschen]]></title><description><![CDATA[<p>Hi Leude,</p>
<p>kurze frage.<br />
Wie kann ich einen ausgewählten eintrag aus einer checkListBox löschen?</p>
<p>Habe folgendes probiert:</p>
<pre><code class="language-cpp">void __fastcall TForm1::wegClick(TObject *Sender)
{
 for (int i=0; i&lt;CheckListBox-&gt;Items-&gt;Count; i++)
  {
    if (CheckListBox-&gt;Checked[i])
     {
         CheckListBox-&gt;Items-&gt;RemoveAt[i];
     }

 }
}
</code></pre>
<p>Jetzt kommt folgender fehler mit dem ich nichts anfangen kann:<br />
[C++ Fehler] Test1.cpp(186): E2235 Elementfunktion muß aufgerufen oder ihre Adresse übernommen werden</p>
<p>Danke Bench</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/205993/checklistbox-eintrag-löschen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 22:00:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/205993.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Feb 2008 09:45:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 09:45:56 GMT]]></title><description><![CDATA[<p>Hi Leude,</p>
<p>kurze frage.<br />
Wie kann ich einen ausgewählten eintrag aus einer checkListBox löschen?</p>
<p>Habe folgendes probiert:</p>
<pre><code class="language-cpp">void __fastcall TForm1::wegClick(TObject *Sender)
{
 for (int i=0; i&lt;CheckListBox-&gt;Items-&gt;Count; i++)
  {
    if (CheckListBox-&gt;Checked[i])
     {
         CheckListBox-&gt;Items-&gt;RemoveAt[i];
     }

 }
}
</code></pre>
<p>Jetzt kommt folgender fehler mit dem ich nichts anfangen kann:<br />
[C++ Fehler] Test1.cpp(186): E2235 Elementfunktion muß aufgerufen oder ihre Adresse übernommen werden</p>
<p>Danke Bench</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459282</guid><dc:creator><![CDATA[Bench_XProjects]]></dc:creator><pubDate>Wed, 20 Feb 2008 09:45:56 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 09:58:15 GMT]]></title><description><![CDATA[<p>ich bekomm eher die Fehlermeldung<br />
[C++ Fehler] Unit1.cpp(24): E2316 'RemoveAt' ist kein Element von 'TStrings'</p>
<p>da <em>Items</em> vom Typ <em>TStrings</em> ist, solltest du die Funktion <em>Delete</em> verwenden</p>
<p>was steht denn in Zeile 186?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459292</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Wed, 20 Feb 2008 09:58:15 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 10:02:32 GMT]]></title><description><![CDATA[<p>Hi ,</p>
<p>sorry, habe schon Delete statt RemoveAt verwendet und da kommt die oben ganannte Fehlermeldung!!</p>
<p>Weisst du warum?</p>
<p>danke Bench</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459297</guid><dc:creator><![CDATA[Bench_XProjects]]></dc:creator><pubDate>Wed, 20 Feb 2008 10:02:32 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 10:10:14 GMT]]></title><description><![CDATA[<p>Mit Delete bekomme ich keine Fehlermeldung. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<pre><code class="language-cpp">for (int i=0; i&lt;CheckListBox1-&gt;Items-&gt;Count; i++)
  {
    if (CheckListBox1-&gt;Checked[i])
     {
         CheckListBox1-&gt;Items-&gt;Delete(i);
     }

 }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1459302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459302</guid><dc:creator><![CDATA[zwitch]]></dc:creator><pubDate>Wed, 20 Feb 2008 10:10:14 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 10:22:13 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>das ist keine property sondern eine Funktion.</p>
<p>Gruß</p>
<p>Alexander</p>
<p>[Edit]Bezog sich auf die vor-vorherige Nachricht[/Edit]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459303</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Wed, 20 Feb 2008 10:22:13 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 10:14:41 GMT]]></title><description><![CDATA[<p>upps so solls sein.</p>
<pre><code class="language-cpp">for (int i=0; i&lt;CheckListBox1-&gt;Items-&gt;Count; i++)
  {
    if (CheckListBox1-&gt;Checked[i])
     {
         CheckListBox1-&gt;Items-&gt;Delete(i--);
     }

 }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1459306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459306</guid><dc:creator><![CDATA[zwitch]]></dc:creator><pubDate>Wed, 20 Feb 2008 10:14:41 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 10:24:40 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>beim Löschen würde ich empfehlen rückwärts zu iterieren.</p>
<pre><code class="language-cpp">for (int i = CheckListBox1-&gt;Items-&gt;Count - 1; i &gt;= 0; --i)
</code></pre>
<p>Gruß</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459311</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Wed, 20 Feb 2008 10:24:40 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 10:59:24 GMT]]></title><description><![CDATA[<p>Alexander Kempf schrieb:</p>
<blockquote>
<p>Hallo,</p>
<p>beim Löschen würde ich empfehlen rückwärts zu iterieren.</p>
<pre><code class="language-cpp">for (int i = CheckListBox1-&gt;Items-&gt;Count - 1; i &gt;= 0; --i)
</code></pre>
<p>Gruß</p>
<p>Alexander</p>
</blockquote>
<p>Ist aber bei dieser Gegebenheit nicht umbedingt erforderlich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459339</guid><dc:creator><![CDATA[zwitch]]></dc:creator><pubDate>Wed, 20 Feb 2008 10:59:24 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 11:38:40 GMT]]></title><description><![CDATA[<p>zwitch schrieb:</p>
<blockquote>
<p>Ist aber bei dieser Gegebenheit nicht umbedingt erforderlich.</p>
</blockquote>
<p>Was ist schon unbedingt erforderlich?<br />
Aber bevor es philosophisch wird...<br />
Für mich ist ein Rückwärtsiterieren aus zwei Gründen empfehlenswert:</p>
<p>1. Das ist gängige Praxis (soweit ich das überschauen kann).<br />
2. Man sollte nicht innerhalb einer for-Schleife den Schleifenparameter verändern.<br />
Das führt zu schlechterer Lesbarkeit und damit zu Verwirrungen und letztlich möglicherweise Fehlern.</p>
<p>Natürlich ist das hier sehr überschaubar, aber:</p>
<p>1. Der Code kann noch wachsen.<br />
2. Der Mensch ist ein Gewohnheitstier...</p>
<p>Gruß</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459363</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459363</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Wed, 20 Feb 2008 11:38:40 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 13:22:01 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ok jetzt gehts.<br />
Habe statt Delete(i--) Delete[i] gehabt!<br />
da hat er wegen der klammer gamault!!!</p>
<p>Ich danke Bench</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459431</guid><dc:creator><![CDATA[Bench_XProjects]]></dc:creator><pubDate>Wed, 20 Feb 2008 13:22:01 GMT</pubDate></item><item><title><![CDATA[Reply to CheckListBox Eintrag löschen on Wed, 20 Feb 2008 13:34:13 GMT]]></title><description><![CDATA[<p>Alexander Kempf schrieb:</p>
<blockquote>
<p>beim Löschen würde ich empfehlen rückwärts zu iterieren.</p>
</blockquote>
<p>Dem möchte ich mich anschließen...</p>
<p>Bench_XProjects schrieb:</p>
<blockquote>
<p>Habe statt Delete(i--) Delete[i] gehabt!<br />
da hat er wegen der klammer gamault!!!</p>
</blockquote>
<p>Aber auch nur wegen der Klammer. Das i-- ist ein post-operator, das heißt i wird erst nach Abschluß der Funktion dekrementiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1459446</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1459446</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 20 Feb 2008 13:34:13 GMT</pubDate></item></channel></rss>