Autor Beitrag
Lemon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 96

Win XP
D5 Standart
BeitragVerfasst: So 19.03.06 13:17 
habe folgende prozedur im netz gefunden:

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


diese prozedur bewirkt, dass nur zahlen in das edit-feld eingegeben werden koennen. ich verstehe diese zeilen auch bis auf #8 im set. was genau bewirkt #8?
vielen dank schonmal im vorraus!

Moderiert von user profile iconGausi: Beitragsformatierung überarbeitet.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 19.03.06 13:40 
Hallo,

#8:
ASCII: 8 = Zeichen-Rücksschritt = BS = BackSpace,
damit man noch Zeichen im Edit löschen kann.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )