Autor Beitrag
Dave_Bowman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Mo 07.06.04 17:30 
Hallo,

ich möchte gern in einem Edit-Feld nur Zahlen zulassen, d.h., ich muss alles außer Zahlen abfangen. Dafür, denke ich, bietet sich das KeyPress-Ereignis an, dort kann ich ja prima die Variable KEY verändern (ziemlich leicht), nur wie kann ich sie ganz löschen bzw. veranlassen, dass er nach dieser Prozedur die Weiterverarbeitung nicht fortführt? Gibt's da 'ne Möglichkeit?

Danke Euch ...


Chris
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mo 07.06.04 17:35 
Hallo!

Versuchs mal mit:

ausblenden Delphi-Quelltext
1:
if not (key in ['0'..'9',#8]) then key:=#0;					
Dave_Bowman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Mo 07.06.04 18:39 
Großartig, genau das habe ich gesucht. '#0' war die Lösung. Danke Karlson!

Chris
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mo 07.06.04 19:11 
kein Problem! Dazu gibts ja des Forum.