如何使EDIT等只接受数字
如题
[解决办法]
if not (Key in [#8, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', #46,#37,#39]) then begin Key := #0;beep; end;
begin
... ...
end;
[解决办法]
给你一个函数:
SetWindowLong(edt1.Handle, GWL_STYLE, GetWindowLong(EditWnd, GWL_STYLE) or ES_NUMBER)就可以达到只能输入数字。