if not (Key in ['0'..'9', 'a'..'z', 'A'..'Z', #8, #13]) then begin Key := #0; ShowMessage('请输入数字或字母'); end;