<?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[Variable Anzahl Checkboxen]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bin noch Programmieranfänger und hätte eine Frage bzgl. einer variablen ANzahl an Checkboxen.</p>
<p>D.h. wie schaffe ich es eine variable Anzahl an Checkboxen zu erstellen. Ohne das ich es auf meine Form ziehe sondern je nach bedarf eine weitere oder z.B. gleich 3 Checkboxen erstellt werden?</p>
<p>Danke für eure Mühe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/155152/variable-anzahl-checkboxen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 18:45:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/155152.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Aug 2006 08:48:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Thu, 03 Aug 2006 08:48:51 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bin noch Programmieranfänger und hätte eine Frage bzgl. einer variablen ANzahl an Checkboxen.</p>
<p>D.h. wie schaffe ich es eine variable Anzahl an Checkboxen zu erstellen. Ohne das ich es auf meine Form ziehe sondern je nach bedarf eine weitere oder z.B. gleich 3 Checkboxen erstellt werden?</p>
<p>Danke für eure Mühe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109703</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109703</guid><dc:creator><![CDATA[Aeris]]></dc:creator><pubDate>Thu, 03 Aug 2006 08:48:51 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Thu, 03 Aug 2006 08:55:35 GMT]]></title><description><![CDATA[<p>Schau doch einfach mal in die FAQ unter &quot;Komponenten benutzen&quot;<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39206.html" rel="nofollow">zur Laufzeit erstellen, anzeigen und Events zuweisen</a><br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39211.html" rel="nofollow">Dynamische Arrays von Komponenten oder Objekten</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109710</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 03 Aug 2006 08:55:35 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Thu, 03 Aug 2006 10:48:51 GMT]]></title><description><![CDATA[<pre><code>const int x = 5;

        TCheckBox *Checkbox[x];
        for (int i = 0; i &lt; x; i++)
        {

        Checkbox[i] = new TCheckBox(this);

        Checkbox[i]-&gt;Parent = this;

        Checkbox[i]-&gt;Height = 32;
        Checkbox[i]-&gt;Top = 30;
        Checkbox[i]-&gt;Show();
        Checkbox[i]-&gt;Caption = FILINGSYSTEM-&gt;edtARTIKEL-&gt;Text + i;
        Checkbox[i]-&gt;Alignment = akLeft, akTop;
        Checkbox[i]-&gt;BiDiMode = bdLeftToRight;
        Checkbox[i]-&gt;Ctl3D = true;
        Checkbox[i]-&gt;Cursor = crDefault;
        Checkbox[i]-&gt;Enabled = true;
        Checkbox[i]-&gt;TabOrder = 3;
        Checkbox[i]-&gt;TabStop = true;
        Checkbox[i]-&gt;Width = 75;
</code></pre>
<p>ok danke, ich habs. Noch eine Frage: Die Checkboxen stehen jetzt mitten im Raum gibt es eine Möglichkeit zu sagenn, dass sie nicht untereinander sondern nach jeder 2ten Checkbox nebeneinander stehen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109790</guid><dc:creator><![CDATA[Aeris2]]></dc:creator><pubDate>Thu, 03 Aug 2006 10:48:51 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Thu, 03 Aug 2006 11:02:53 GMT]]></title><description><![CDATA[<p>setze hier</p>
<p>Checkbox[i]-&gt;Height = 32;<br />
Checkbox[i]-&gt;Top = 30;</p>
<p>die gewünschten Werte ein</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109802</guid><dc:creator><![CDATA[Christian411]]></dc:creator><pubDate>Thu, 03 Aug 2006 11:02:53 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Thu, 03 Aug 2006 11:03:29 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>du must selber Position (Left, Top) und Dimension (Height, Width) für jedes Control festlegen, anstatt Aligment zu benutzen.<br />
Auch ist es Unsinn jedem Control dasselbe TabOrder zuzuweisen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109803</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 03 Aug 2006 11:03:29 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Thu, 03 Aug 2006 11:12:47 GMT]]></title><description><![CDATA[<blockquote>
<p>Auch ist es Unsinn jedem Control</p>
</blockquote>
<p>wie<br />
Checkbox[i]-&gt;Show();<br />
Checkbox[i]-&gt;BiDiMode = bdLeftToRight;<br />
Checkbox[i]-&gt;Ctl3D = true;<br />
Checkbox[i]-&gt;Cursor = crDefault;<br />
Checkbox[i]-&gt;Enabled = true;</p>
<p>da dies Defaultwerte sind</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109809</guid><dc:creator><![CDATA[Christian411]]></dc:creator><pubDate>Thu, 03 Aug 2006 11:12:47 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Fri, 04 Aug 2006 06:03:31 GMT]]></title><description><![CDATA[<p>Guten Morgen,<br />
ich hab es jetzt abgeändert, aber meine Checkboxen sind irgendwie nich auf gleicher Höhe, könnt ihr mir einen tipp geben?</p>
<pre><code>const int x = 10;

        TCheckBox *Checkbox[x];

        for (int i = 0; i &lt; x; i++)
        {
            Checkbox[i] = new TCheckBox(this);

            Checkbox[i]-&gt;Parent = this;

            Checkbox[i]-&gt;Height = 32;
            Checkbox[i]-&gt;Top = FILINGSYSTEM-&gt;btnAction-&gt;Top - i * 25 +30 ;

                if(i%2 == 0)
                {
                    Checkbox[i]-&gt;Left = 10;
                    Checkbox[i]-&gt;Top = 120+i*20;
                }
                else
                {
                    Checkbox[i]-&gt;Left = 130;
                    Checkbox[i]-&gt;Top = 120+i*20;
                }
                    Checkbox[i]-&gt;Caption = FILINGSYSTEM-&gt;edtARTIKEL-&gt;Text + i;
                }
        }
        else
        ;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1110279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110279</guid><dc:creator><![CDATA[Aeris]]></dc:creator><pubDate>Fri, 04 Aug 2006 06:03:31 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Fri, 04 Aug 2006 06:26:39 GMT]]></title><description><![CDATA[<p>wozu machst du</p>
<pre><code class="language-cpp">Checkbox[i]-&gt;Top = FILINGSYSTEM-&gt;btnAction-&gt;Top - i * 25 +30;
</code></pre>
<p>wenn du danach noch</p>
<pre><code class="language-cpp">Checkbox[i]-&gt;Top = 120+i*20;
</code></pre>
<p>machst?</p>
<p>zum eigentlichen Problem:<br />
du machst in der If-Abfrage beide male</p>
<pre><code class="language-cpp">Checkbox[i]-&gt;Top = 120+i*20;
</code></pre>
<p>d.h. du zählst Top bei jeder CheckBox um 20 höher,<br />
eventuell hilft hier ein (i-1) an der richtigen stelle <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1110291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110291</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Fri, 04 Aug 2006 06:26:39 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Fri, 04 Aug 2006 07:48:45 GMT]]></title><description><![CDATA[<p>i-1 bringts hier nicht. Das andere was Linnea gesagt hat stimmt soweit. Ich würd aber mal drüber nachdenken wie du die Boxen verteilen willst und warum du einen vertikale Abstand von 20 einstellst, wo doch deine Boxen 32 hoch sind. Probier das hier mal</p>
<pre><code class="language-cpp">const int x = 10;
TCheckBox *Checkbox[x];

for (int i = 0; i &lt; x; i++)
{
   Checkbox[i] = new TCheckBox(this);
   Checkbox[i]-&gt;Parent = this;
   Checkbox[i]-&gt;Height = 32;
   Checkbox[i]-&gt;Width = 100;
   if( i&lt;x/2) 
   {
      Checkbox[i]-&gt;Top = 120 + i*40;
      Checkbox[i]-&gt;Left = 10;
   } else
   {
      Checkbox[i]-&gt;Top = 120 + (i-x/2)*40;
      Checkbox[i]-&gt;Left = 120;
   }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1110330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110330</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 04 Aug 2006 07:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Fri, 04 Aug 2006 08:33:07 GMT]]></title><description><![CDATA[<p>*seufz* jetzt muss ich das wohl doch hinschreiben<br />
es reicht auch</p>
<pre><code>if (i%2 == 0)
    {
    Checkbox[i]-&gt;Left = 10;
    Checkbox[i]-&gt;Top = 120+i*20;
    }
else
    {
    Checkbox[i]-&gt;Left = 130;
    Checkbox[i]-&gt;Top = 120+[b](i-1)[/b]*20;
    }
</code></pre>
<p>um die Checkboxen in 2 Spalten darzustellen</p>
<p>[Edit] es kommt halt drauf an wie die Checkboxen angeordnet werden sollen:</p>
<pre><code>CheckBox1        CheckBox2
CheckBox3        CheckBox4
CheckBox5        CheckBox6
...
</code></pre>
<p>oder Braunsteins-Lösung</p>
<pre><code>CheckBox1        CheckBox6
CheckBox2        CheckBox7
CheckBox3        CheckBox8
...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1110368</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110368</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Fri, 04 Aug 2006 08:33:07 GMT</pubDate></item><item><title><![CDATA[Reply to Variable Anzahl Checkboxen on Fri, 04 Aug 2006 10:24:25 GMT]]></title><description><![CDATA[<p>Stimmt allerdings. <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/1110454</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110454</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 04 Aug 2006 10:24:25 GMT</pubDate></item></channel></rss>