<?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[PaintBox]]></title><description><![CDATA[<p>Hallo da draussen!</p>
<p>Kann mir einer sagen, was ich falsch mache?!</p>
<p>Ich möchte mit der PaintBox ein Gatter für ein Vier gewinnt spiel zeichnen. Allerdings stürzt mir das Programm beim Aufrufen jedes mal ab. Kann mir einer bitte sagen wo der Fehler liegt?</p>
<pre><code>__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
//erstellt einen Rahmen (Quadrat)
Form1-&gt;PB-&gt;Canvas-&gt;MoveTo(10,10);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(10,240);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(240,240);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(240,10);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(10,10);
//zeichnet waagerechte Linien mit 5 Pixel Abstand
for (int i = 0;i&lt;=250;i+5)
{
 Form1-&gt;PB-&gt;Canvas-&gt;MoveTo(1,i);
 Form1-&gt;PB-&gt;Canvas-&gt;LineTo(250,i);
}

}
</code></pre>
<p>Vielen Dank schon mal!</p>
<p>Eleonora</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/76667/paintbox</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 01:12:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/76667.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Jun 2004 07:44:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PaintBox on Mon, 14 Jun 2004 07:44:11 GMT]]></title><description><![CDATA[<p>Hallo da draussen!</p>
<p>Kann mir einer sagen, was ich falsch mache?!</p>
<p>Ich möchte mit der PaintBox ein Gatter für ein Vier gewinnt spiel zeichnen. Allerdings stürzt mir das Programm beim Aufrufen jedes mal ab. Kann mir einer bitte sagen wo der Fehler liegt?</p>
<pre><code>__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
//erstellt einen Rahmen (Quadrat)
Form1-&gt;PB-&gt;Canvas-&gt;MoveTo(10,10);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(10,240);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(240,240);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(240,10);
Form1-&gt;PB-&gt;Canvas-&gt;LineTo(10,10);
//zeichnet waagerechte Linien mit 5 Pixel Abstand
for (int i = 0;i&lt;=250;i+5)
{
 Form1-&gt;PB-&gt;Canvas-&gt;MoveTo(1,i);
 Form1-&gt;PB-&gt;Canvas-&gt;LineTo(250,i);
}

}
</code></pre>
<p>Vielen Dank schon mal!</p>
<p>Eleonora</p>
]]></description><link>https://www.c-plusplus.net/forum/post/539673</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/539673</guid><dc:creator><![CDATA[Eleonora]]></dc:creator><pubDate>Mon, 14 Jun 2004 07:44:11 GMT</pubDate></item><item><title><![CDATA[Reply to PaintBox on Mon, 14 Jun 2004 07:52:13 GMT]]></title><description><![CDATA[<p>Das ist doch der Konstruktor, in dem das aufgerufen wird. Da gibt es wohl noch keinen Canvas für PB.<br />
Canvaszugriffe gehören in das OnPaint()-Ereignis des Forms, damit die Ausgabe auch wieder erfolgt, wenn ein anderes Fenster über der Form war, respektive das Form minimiert und wieder maximiert wird, usw.</p>
<p>Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/539683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/539683</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 14 Jun 2004 07:52:13 GMT</pubDate></item><item><title><![CDATA[Reply to PaintBox on Mon, 14 Jun 2004 08:10:03 GMT]]></title><description><![CDATA[<p>Außerdem hast Du eine Endlosschleife programmiert:</p>
<pre><code class="language-cpp">for (int i = 0;i&lt;=250;i+5)
</code></pre>
<p>Die Zeile muss heißen:</p>
<pre><code class="language-cpp">for (int i = 0;i&lt;=250;i+=5)
</code></pre>
<p>Und ich hab' noch gesehen, dass TPaintBox eine eigenes OnPaint()-Ereignis hat. Also besser das nehmen.</p>
<p>Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/539689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/539689</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 14 Jun 2004 08:10:03 GMT</pubDate></item><item><title><![CDATA[Reply to PaintBox on Mon, 14 Jun 2004 08:30:23 GMT]]></title><description><![CDATA[<p>Das mit der PaintBox funktioniert jetzt, und den Fehler mit der Endlosschleife habe ich beim Aufrufen auch bemerkt und gleich geändert.</p>
<p>DANKE!</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/539704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/539704</guid><dc:creator><![CDATA[Eleonora]]></dc:creator><pubDate>Mon, 14 Jun 2004 08:30:23 GMT</pubDate></item></channel></rss>