12 //输入12
12.1 //输入12.1
12.12 //输入12.12
12.121 //输入12.12
12.1 //输入12.1
12.12 //输入12.12
12.121 //输入12.12
解决方案 »
- oracle查询相同字段问题
- 为什么用SENDTEXT发过去的串,客户端收到的有时是乱码?用SEDNBUF有时也是乱码?谢谢!
- insert 后报错
- 高手请进!蓬荜生辉啊!!
- 菜鸟问题,
- 在任务栏右下角如何隐藏qq图标????
- 这就是csdn的服务质量
- 如何使程序只有在关闭操作系统时才关闭
- 如何在Delphi中读取Bios中的内容?
- 请问Delphi可以用来编视频方面的东西吗?怎么入手?请大家帮帮我!
- 利用API获得硬盘序列号,需要支持IDE和SCSI硬盘的
- 急!!!!!难!!!!!gridehlib控件的列checkbox只支持boolean数据类型,哪位大侠帮忙改成支持integer类型啊
var
s: string;
i: integer;
begin
s:= edit1.Text;
for i:= 0 to length(s)-1 do
begin
if s[i] = '.' then
begin
if length(s)-i >1 then key:= #0;
end;
end;
end;
var
s: string;
i,j: integer;
begin
s:= edit1.Text;
i:=pos('.',s);
j:=Length(s);
if j-i>=2 then
key:= #0;
end;
begin
if MyKess.SelLength =length(MyKess.Text) then
MyKess.Clear;
if (Key <> '1') and (Key <> '2') and (Key <> '3') and (Key <> '4') and (Key <>
'5') and (Key <> '6') and (Key <> '7') and (Key <> '8') and (Key <> '9') and
(Key <> '0') and (Key <> '.') and (Key <> '-') then
begin
if Key <> #8 then
Key := char(0);
end
else
begin
if Key = '.' then
begin
if pos('.', MyKess.Text) <> 0 then
Key := char(0)
end
else
if Key = '-' then
begin
if trim(MyKess.Text)<>'' then
Key := char(0)
end
else
begin
if (pos('.', MyKess.Text) <> 0) and (Length(copy(MyKess.Text, pos('.',
MyKess.Text) + 1, Length(MyKess.Text))) > Len - 1) then
Key := char(0)
else
//if Key='0' then
begin
if (trim(MyKess.text)='0') or (trim(MyKess.text)='-0') then
Key := char(0)
end;
end;
end;
end;这个函数能满足你
EditKeyPress事件中:MyKeyPress(edit1,2, Key);
正则表达式
'5') and (Key <> '6') and (Key <> '7') and (Key <> '8') and (Key <> '9') and
(Key <> '0') and (Key <> '.') and (Key <> '-') 眼花,用in不好吗?呵呵