在回車鍵事件中加入:
if not (key in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', #8, #13]) then
key := char(0); //key:=char(' ');//#8是回退鍵,#13是回車鍵
即可限定數字輸入。
在回車鍵事件中加入:
if not (key in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', #8, #13]) then
key := char(0); //key:=char(' ');//#8是回退鍵,#13是回車鍵
即可限定數字輸入。
複製這段內容後打開百度網盤APP,操作更方便哦。鏈接: https://pan.baidu.com/s/1H2SxV5Ngeo_eRSEfk60cQQ 提取碼:u4ef
在dpr文件加進去: {$SETPEOSVERSION 5.0} {$SETPESUBSYSVERSION 5.0} 非原創 轉載自 QQ羣 無連接