<?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[BCB 5 - Tastenblockierung?]]></title><description><![CDATA[<p>Hallo,<br />
ich bin grad dabei mit Edit-Feldern im Objektinspektor unter Ereignisse/OnKeyPress am experimentieren.</p>
<p>Dazu habe ich, um nurnoch die Eingaben 0-9 und Komma und Backspace zu erlauben, im Objektiinspektor unter Ereignisse/OnKeyPress folgenden Code eingegeben:</p>
<pre><code>// Tastenblockierungen für &quot;Gewinn aus Gewerbebetrieb&quot;
void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &amp;Key)
{
    if ( Key &gt;= '0' &amp;&amp; Key &lt;= '9' || Key == ',' || Key == 0x08 )
{
}
    else
{
    Key = 0x00;     // keine Reaktion
}
}
</code></pre>
<p>Funktioniert auch alles ganz Prima. Ich würde aber noch gerne erreichen, dass das Komma nur 1x reagiert. Hat vielleicht jemand ne Idee oder ne Patentlösung?</p>
<p>thx<br />
G-Kar</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/167171/bcb-5-tastenblockierung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 03:53:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167171.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Dec 2006 13:15:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to BCB 5 - Tastenblockierung? on Thu, 07 Dec 2006 13:15:37 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich bin grad dabei mit Edit-Feldern im Objektinspektor unter Ereignisse/OnKeyPress am experimentieren.</p>
<p>Dazu habe ich, um nurnoch die Eingaben 0-9 und Komma und Backspace zu erlauben, im Objektiinspektor unter Ereignisse/OnKeyPress folgenden Code eingegeben:</p>
<pre><code>// Tastenblockierungen für &quot;Gewinn aus Gewerbebetrieb&quot;
void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &amp;Key)
{
    if ( Key &gt;= '0' &amp;&amp; Key &lt;= '9' || Key == ',' || Key == 0x08 )
{
}
    else
{
    Key = 0x00;     // keine Reaktion
}
}
</code></pre>
<p>Funktioniert auch alles ganz Prima. Ich würde aber noch gerne erreichen, dass das Komma nur 1x reagiert. Hat vielleicht jemand ne Idee oder ne Patentlösung?</p>
<p>thx<br />
G-Kar</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1188329</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1188329</guid><dc:creator><![CDATA[G-Kar]]></dc:creator><pubDate>Thu, 07 Dec 2006 13:15:37 GMT</pubDate></item><item><title><![CDATA[Reply to BCB 5 - Tastenblockierung? on Thu, 07 Dec 2006 13:39:28 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool komma = false;

void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &amp;Key)
{

if ( Key &gt;= '0' &amp;&amp; Key &lt;= '9' || Key == ',' &amp;&amp; komma == false || Key == 0x08 )
{
   if (Key == ',')
       komma = true;
}
else
{
    Key = 0x00;     // keine Reaktion
}
}
</code></pre>
<p>oder du nimmst n maskedit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1188353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1188353</guid><dc:creator><![CDATA[_guest_]]></dc:creator><pubDate>Thu, 07 Dec 2006 13:39:28 GMT</pubDate></item><item><title><![CDATA[Reply to BCB 5 - Tastenblockierung? on Thu, 07 Dec 2006 14:09:36 GMT]]></title><description><![CDATA[<p>thx, funktioniert. Allerdings bringt die Lösung zu ein neues Problem:<br />
Wenn man jetzt wegen einer Korrektur das Komma wieder löscht, kann man kein neues mehr einfügen......</p>
<p>Naja, dann hab ich ja wieder was zum knobeln. Wenn jemand ne Lösung weiß, immer her damit.</p>
<p>cu<br />
G-Kar</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1188382</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1188382</guid><dc:creator><![CDATA[G-Kar]]></dc:creator><pubDate>Thu, 07 Dec 2006 14:09:36 GMT</pubDate></item><item><title><![CDATA[Reply to BCB 5 - Tastenblockierung? on Thu, 07 Dec 2006 14:55:39 GMT]]></title><description><![CDATA[<p>dann überprüfe halt, ob im text ein komma vorhanden ist, wenn ja darf keins mehr rein, sonst ja</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1188408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1188408</guid><dc:creator><![CDATA[ser1al_ausgeloggt]]></dc:creator><pubDate>Thu, 07 Dec 2006 14:55:39 GMT</pubDate></item></channel></rss>