Autor Beitrag
Fabian
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Mi 17.07.02 13:56 
Wie kann ich, wenn der Anwender in ein Eingabefeld, dessen Inhalt in eine numerische Variable umgewandelt wird, verhindern das es zu einem Convertierungsfehler kommt, wenn der Anwender etwas anderes als eine Zahl eingibt ?
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Mi 17.07.02 14:27 
einen Maskedit benutzen und dort nur Zahlen zulassen
Murdock1
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Mi 17.07.02 15:50 
oder so

ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if not (key in ['0'..'9',#8]) then
    key:=#0;
end;


... fängt alle Tastendrücke ausser Zahlen ab...


mfg Peter

Code-Tag eingefügt. Marc