<?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[hopsender Label]]></title><description><![CDATA[<p>Wie muss ich hier programmieren, dass der hopsende Label mit einem einmaligem click bis zum minimun oben, minimun links, maximum rechts und maximum unten hopst also quasi wie ein Ball<br />
Ich dachte an eine for-Schleife</p>
<pre><code class="language-cpp">private:
  int maxheight;  // Maximalhöhe festlegen
  int maxwidth;   // Maximalbreite festlegen
//--------------------------------------------------------------------------- 

__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
   maxheight = 350;
   maxwidth = 650;
}
//--------------------------------------------------------------------------- 

void __fastcall TForm1::Button_obenClick(TObject *Sender)
{
   if(Label_1-&gt;Top &lt;= 11) {
      ShowMessage(&quot;minimun oben erreicht&quot;);
   }
   else {
      Label_1-&gt;Top = Label_1-&gt;Top -10;
   }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button_linksClick(TObject *Sender)
{
   if(Label_1-&gt;Left &lt;= 11) {
      ShowMessage(&quot;minimun links erreicht&quot;);
   }
   else {
      Label_1-&gt;Left = Label_1-&gt;Left - 10;
   }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button_rechtsClick(TObject *Sender)
{
   if(Label_1-&gt;Left &gt;= maxwidth) {
      ShowMessage(&quot;maximum rechts erreicht&quot;);
   }
   else {
      Label_1-&gt;Left = Label_1-&gt;Left +10;
   }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button_untenClick(TObject *Sender)
{
   if(Label_1-&gt;Top &gt;= maxheight) {
      ShowMessage(&quot;maximum unten erreicht&quot;);
   }
   else {
      Label_1-&gt;Top = Label_1-&gt;Top + 10;
   }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/174621/hopsender-label</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 20:14:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174621.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Mar 2007 10:54:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to hopsender Label on Thu, 01 Mar 2007 10:54:56 GMT]]></title><description><![CDATA[<p>Wie muss ich hier programmieren, dass der hopsende Label mit einem einmaligem click bis zum minimun oben, minimun links, maximum rechts und maximum unten hopst also quasi wie ein Ball<br />
Ich dachte an eine for-Schleife</p>
<pre><code class="language-cpp">private:
  int maxheight;  // Maximalhöhe festlegen
  int maxwidth;   // Maximalbreite festlegen
//--------------------------------------------------------------------------- 

__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
   maxheight = 350;
   maxwidth = 650;
}
//--------------------------------------------------------------------------- 

void __fastcall TForm1::Button_obenClick(TObject *Sender)
{
   if(Label_1-&gt;Top &lt;= 11) {
      ShowMessage(&quot;minimun oben erreicht&quot;);
   }
   else {
      Label_1-&gt;Top = Label_1-&gt;Top -10;
   }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button_linksClick(TObject *Sender)
{
   if(Label_1-&gt;Left &lt;= 11) {
      ShowMessage(&quot;minimun links erreicht&quot;);
   }
   else {
      Label_1-&gt;Left = Label_1-&gt;Left - 10;
   }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button_rechtsClick(TObject *Sender)
{
   if(Label_1-&gt;Left &gt;= maxwidth) {
      ShowMessage(&quot;maximum rechts erreicht&quot;);
   }
   else {
      Label_1-&gt;Left = Label_1-&gt;Left +10;
   }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button_untenClick(TObject *Sender)
{
   if(Label_1-&gt;Top &gt;= maxheight) {
      ShowMessage(&quot;maximum unten erreicht&quot;);
   }
   else {
      Label_1-&gt;Top = Label_1-&gt;Top + 10;
   }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1237328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237328</guid><dc:creator><![CDATA[Renate]]></dc:creator><pubDate>Thu, 01 Mar 2007 10:54:56 GMT</pubDate></item><item><title><![CDATA[Reply to hopsender Label on Thu, 01 Mar 2007 11:27:53 GMT]]></title><description><![CDATA[<p>Wieso denn noch einen neuen Thread?!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237354</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 01 Mar 2007 11:27:53 GMT</pubDate></item><item><title><![CDATA[Reply to hopsender Label on Thu, 01 Mar 2007 11:35:14 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>hier gehts <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-174487.html" rel="nofollow">weiter</a>.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237357</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 01 Mar 2007 11:35:14 GMT</pubDate></item></channel></rss>