OnKeyPress Event에서 Util_ChkKeyPress_VaidNum() 함수 호춤.
function Util_ChkKeyPress_VaidNum(Key:Char):Boolean;
begin
if Key in ['0'..'9','-',#8,#9,#32,#3,#22] then // 0~9, -, Tab, BS, Space, Ctrl+C, Ctrl+V 만 유효
result := True
else
result := False;
end;
function Util_ChkKeyPress_VaidNum(Key:Char):Boolean;
begin
if Key in ['0'..'9','-',#8,#9,#32,#3,#22] then // 0~9, -, Tab, BS, Space, Ctrl+C, Ctrl+V 만 유효
result := True
else
result := False;
end;
'Programming & Tools > Delphi' 카테고리의 다른 글
[Delphi] Sting & Char 관련 (0) | 2010.04.29 |
---|---|
[Delphi] String 내용 중 원하는 내용만 바꾸기 (0) | 2010.04.29 |
[Delphi] sysutils.pas 의 유용한 함수 (0) | 2010.03.17 |
[Delphi] TMemo 및 TRichEdit 자동 스크롤. (0) | 2010.03.15 |