<?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[Mehrere Checkboxen auf einmal auswählen]]></title><description><![CDATA[<p>Hallo,<br />
ich möchte bei einem Click auf einen Button alle sich in einer Group Box befindlichen Checkboxen auf einmal anwählen.<br />
Nach einem Beispiel hier im Forum habe ich das folgendermaßen versucht:</p>
<pre><code>void __fastcall TForm1::Button1Click(TObject *Sender)
{
    for (int i=0; i&lt; GroupBox1-&gt;ComponentCount; i++)
    {
     dynamic_cast&lt;TCheckBox*&gt;(GroupBox1-&gt;Components[i])-&gt;SetChecked(TRUE);
    }
}
</code></pre>
<p>Bekomme dann aber folgende Fehlermeldung:</p>
<p>E2247 Zugriff auf '_fastcall TCustomCheckBox::SetChecked(bool)' nicht möglich</p>
<p>Scheint mir die Typumwandlung nicht zu stimmen, aber was wäre denn da richtig?</p>
<p>Besten Dank im Voraus,<br />
Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/90260/mehrere-checkboxen-auf-einmal-auswählen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 11:17:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/90260.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Oct 2004 21:48:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mehrere Checkboxen auf einmal auswählen on Wed, 27 Oct 2004 21:48:27 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich möchte bei einem Click auf einen Button alle sich in einer Group Box befindlichen Checkboxen auf einmal anwählen.<br />
Nach einem Beispiel hier im Forum habe ich das folgendermaßen versucht:</p>
<pre><code>void __fastcall TForm1::Button1Click(TObject *Sender)
{
    for (int i=0; i&lt; GroupBox1-&gt;ComponentCount; i++)
    {
     dynamic_cast&lt;TCheckBox*&gt;(GroupBox1-&gt;Components[i])-&gt;SetChecked(TRUE);
    }
}
</code></pre>
<p>Bekomme dann aber folgende Fehlermeldung:</p>
<p>E2247 Zugriff auf '_fastcall TCustomCheckBox::SetChecked(bool)' nicht möglich</p>
<p>Scheint mir die Typumwandlung nicht zu stimmen, aber was wäre denn da richtig?</p>
<p>Besten Dank im Voraus,<br />
Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/638983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/638983</guid><dc:creator><![CDATA[Thomas_v2.1]]></dc:creator><pubDate>Wed, 27 Oct 2004 21:48:27 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Checkboxen auf einmal auswählen on Thu, 28 Oct 2004 01:19:38 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
   for (int i=0; i&lt; Form1-&gt;ComponentCount ; i++)
   {
      if(Form1-&gt;Components[i]-&gt;ClassNameIs(&quot;TCheckBox&quot;))
      {
         dynamic_cast&lt;TCheckBox*&gt;(Form1-&gt;Components[i])-&gt;Checked=true;
      }
   }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/639046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639046</guid><dc:creator><![CDATA[stevie71]]></dc:creator><pubDate>Thu, 28 Oct 2004 01:19:38 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Checkboxen auf einmal auswählen on Thu, 28 Oct 2004 05:02:37 GMT]]></title><description><![CDATA[<p>Was passiert eigentlich, wenn in der GroupBox auch z.B. ein Label rumliegt?</p>
<p>Ich würde ja nach der Typumwandlung ne if-Abfrage einbauen, um festzustellen, ob es geklappt hat...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/639056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639056</guid><dc:creator><![CDATA[HEZ]]></dc:creator><pubDate>Thu, 28 Oct 2004 05:02:37 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Checkboxen auf einmal auswählen on Thu, 28 Oct 2004 06:29:45 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>HEZ schrieb:</p>
<blockquote>
<p>Was passiert eigentlich, wenn in der GroupBox auch z.B. ein Label rumliegt?<br />
Ich würde ja nach der Typumwandlung ne if-Abfrage einbauen, um festzustellen, ob es geklappt hat...</p>
</blockquote>
<p>Bei der if-Abfrage wird doch kontrolliert, ob es sich um eine CheckBox handelt und wenn das zutrifft, erst dann wird der dynamic-cast durchgeführt! So kann es doch gar nicht passieren, dass versucht wird ein Label zu casten!!!!</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/639093</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639093</guid><dc:creator><![CDATA[xDannyOx]]></dc:creator><pubDate>Thu, 28 Oct 2004 06:29:45 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Checkboxen auf einmal auswählen on Thu, 28 Oct 2004 06:38:08 GMT]]></title><description><![CDATA[<p>Ach Dreck. Hast Recht. Klar, dann gehts auch. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/639100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639100</guid><dc:creator><![CDATA[HEZ]]></dc:creator><pubDate>Thu, 28 Oct 2004 06:38:08 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere Checkboxen auf einmal auswählen on Thu, 28 Oct 2004 10:28:20 GMT]]></title><description><![CDATA[<p>Danke stevie.<br />
Ich hatte mir das nur so überlegt, wenn ich zwei Group Boxen mit mehreren CheckBoxen habe und einmal alle in der einen Group und einmal alle in der anderen aktivieren möchte.<br />
Da sich in einer Group ausschließlich Checkboxen befinden wollte ich mir so die if-Abfrage sparen.</p>
<p>Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/639257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/639257</guid><dc:creator><![CDATA[Thomas_v2.1]]></dc:creator><pubDate>Thu, 28 Oct 2004 10:28:20 GMT</pubDate></item></channel></rss>