S skyccf Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-28 #2 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if not (key in ['0'..'9','A'..'Z','a'..'z']) then key:=#0; end; 这是只能输入字母和数字的代码,你应该明白了吧
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if not (key in ['0'..'9','A'..'Z','a'..'z']) then key:=#0; end; 这是只能输入字母和数字的代码,你应该明白了吧
X xtqiqi Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-28 #3 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if not (Key in ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', #13, #8]) then begin Key := Char(nil); end; end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if not (Key in ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', #13, #8]) then begin Key := Char(nil); end; end;