在edit1的keypress事件里
if not (Key in ['0'..'9','a'..'z','A'..'Z',#8]) then
   Key:=#0