<?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[MaskEdit]]></title><description><![CDATA[<p>Hallo Leutz,</p>
<p>wie kann ich einem Edit-Feld anweisen, nur Ziffern anzunehmen?<br />
Ein MaskEdit-Feld möchte ich nicht nehmen, weil keine Maske angezeigt werden soll.<br />
Ich habe es versucht mit &quot;KeyDown&quot; oder &quot;KeyUp&quot;, aber ich weiss leider nicht die &quot;Namen&quot; der Tasten 0 - 9<br />
auf der Nummerntastatur oder auf der Normalen.<br />
Die virtuellen sind in der Hilfe von Borland erklärt, aber ich finde nichts<br />
über Buchstaben oder Zahlen.<br />
Man soll die Methode &quot; Ord('M') &quot; benutzen können, aber darüber habe ich<br />
auch nichts gefunden.<br />
Der User darf auch nur 13 Ziffern eingeben und ein Komma soll nach der Zehnten Stelle auch erscheinen.</p>
<p>Ich hoffe das sind nicht zuviel Prob's auf einmal... <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/88157/maskedit</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 05:17:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/88157.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Oct 2004 08:26:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 08:26:54 GMT]]></title><description><![CDATA[<p>Hallo Leutz,</p>
<p>wie kann ich einem Edit-Feld anweisen, nur Ziffern anzunehmen?<br />
Ein MaskEdit-Feld möchte ich nicht nehmen, weil keine Maske angezeigt werden soll.<br />
Ich habe es versucht mit &quot;KeyDown&quot; oder &quot;KeyUp&quot;, aber ich weiss leider nicht die &quot;Namen&quot; der Tasten 0 - 9<br />
auf der Nummerntastatur oder auf der Normalen.<br />
Die virtuellen sind in der Hilfe von Borland erklärt, aber ich finde nichts<br />
über Buchstaben oder Zahlen.<br />
Man soll die Methode &quot; Ord('M') &quot; benutzen können, aber darüber habe ich<br />
auch nichts gefunden.<br />
Der User darf auch nur 13 Ziffern eingeben und ein Komma soll nach der Zehnten Stelle auch erscheinen.</p>
<p>Ich hoffe das sind nicht zuviel Prob's auf einmal... <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/622844</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/622844</guid><dc:creator><![CDATA[MrKidney]]></dc:creator><pubDate>Thu, 07 Oct 2004 08:26:54 GMT</pubDate></item><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 09:36:19 GMT]]></title><description><![CDATA[<p>im Zweifelsfalle baust du nen Handler, der bei einer Änderung des Feldes schaut, ob es eine Zahl ist und wieviele es schon gibt..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/622901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/622901</guid><dc:creator><![CDATA[DocJunioR]]></dc:creator><pubDate>Thu, 07 Oct 2004 09:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 10:25:31 GMT]]></title><description><![CDATA[<p>Mit dem Edit Style ES_NUMBER kannst du das auf Zahlen beschränken,<br />
so z.B.:</p>
<pre><code class="language-cpp">SetWindowLong(EditHwnd, GWL_STYLE, GetWindowLong(EditHwnd, GWL_STYLE) | ES_NUMBER);
</code></pre>
<p>In deinem Fall genügt das aber nicht daher brauchst du eine Eventroutine, bei z.B. Keyup des Edits, dort Überprüfst du dann die Eingaben.<br />
Zur not kannst du auch die WinowProc umstellen zu ner eigenen damit das seperat läuft und übersichtlicher, falls das nicht der Fall sein sollte.</p>
<pre><code class="language-cpp">SetWindowLong(EditHwnd, GWL_WNDPROC, EditProcedure);
</code></pre>
<p>Wie man das dan mit if, else und Co macht, weißt du ja selbst. Ich würde vieleicht auch noch das Clipboard sperren, bevor jemand nen wort rein pasted.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/622939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/622939</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Thu, 07 Oct 2004 10:25:31 GMT</pubDate></item><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 12:24:38 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>hab es so gelöst:</p>
<p>Size = metNettoeinkaufspreisEingabe-&gt;GetTextLen();<br />
Size++;<br />
metNettoeinkaufspreisEingabe-&gt;GetTextBuf(Buffer,Size);</p>
<p>a = Buffer[Size-2]-'0';</p>
<p>if(a == ',' || a == 0 || a == 1 ||<br />
a == 2 || a == 3 || a == 4 || a == 5 ||<br />
a == 6 || a == 7 || a == 8 || a == 9 )<br />
metNettoeinkaufspreisEingabe-&gt;GetTextBuf(Speicher,Size);<br />
else<br />
{<br />
Size--;<br />
Buffer[Size - 2] = '\0';<br />
metNettoeinkaufspreisEingabe-&gt;Text=Buffer;</p>
<p>nicht elegant, aber funktioniert.<br />
Nun springt der Cursor aber immer an die erste Position, wenn man falsch eingibt.<br />
Wie kann ich den Cursor wieder am Ende der Zahl positionieren?<br />
SetCursor(int) soll funktionieren, aber bei mir natürlich nicht.... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<p>KID</p>
]]></description><link>https://www.c-plusplus.net/forum/post/623062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/623062</guid><dc:creator><![CDATA[MrKidney]]></dc:creator><pubDate>Thu, 07 Oct 2004 12:24:38 GMT</pubDate></item><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 12:49:55 GMT]]></title><description><![CDATA[<p>SetCursor hat damit nichts zu tun - schau dir mal <a href="http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_setsel.asp" rel="nofollow">EM_SETSEL</a> an</p>
]]></description><link>https://www.c-plusplus.net/forum/post/623091</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/623091</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 07 Oct 2004 12:49:55 GMT</pubDate></item><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 13:05:16 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>hab ich auch versucht.<br />
Meckert: Aufruf der undefinierten Funktion.<br />
Wie soll ich die Funktion definieren?<br />
Mit #Include&lt;&gt;?<br />
Die Header hab ich schon...</p>
<p>KID</p>
]]></description><link>https://www.c-plusplus.net/forum/post/623118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/623118</guid><dc:creator><![CDATA[MrKidney]]></dc:creator><pubDate>Thu, 07 Oct 2004 13:05:16 GMT</pubDate></item><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 13:09:10 GMT]]></title><description><![CDATA[<p>EM_SETSEL ist keine Funktion, sie wird mittels SendMessage ans Edit gesendet, klick mal auf dem Link von flenders</p>
]]></description><link>https://www.c-plusplus.net/forum/post/623126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/623126</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Thu, 07 Oct 2004 13:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to MaskEdit on Thu, 07 Oct 2004 17:00:17 GMT]]></title><description><![CDATA[<p>Und als Ergänzung:<br />
Bei Keyboard-Eingaben heißt das Ding nicht Cursor (==Maus), sondern <strong>Caret</strong>!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/623428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/623428</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Thu, 07 Oct 2004 17:00:17 GMT</pubDate></item></channel></rss>