delphi中下面的seltext以及Text获取的是什么值 谢谢啊 求助
procedure TEditNum.keypress(var key:char);
var
x,p1,p2,pp1,pp2,p:integer;
tp:Tpoint;
s:string;
begin
if key in ['0'..'9','+','-','.'] then
begin
s:=trim(seltext);
p1:=pos('+',Text)+pos('-',Text);
p2:=pos('.',Text);
pp1:=pos('+',s)+pos('-',s);
pp2:=pos('.',s);
if self.Ctl3D then p:=1 else p:=2;
if (trim(text)=trim(seltext)) then x:=1
else x:=0;
GetCaretPos(tp);
if (isfull)and(s='') then key:=#0;
if (tp.x=p)and(p1>0)and(pp1=0)and(x=0) then key:=#0;
if (key='+')or(key='-') then
if ((p1>0)or(tp.x>p))and(pp1=0)and(x=0) then key:=#0;
if (key='.') then
if ((p2>0)and(pp2=0)and(x=0))or(flength2<=0) then key:=#0;
end
else if key>#31 then key:=#0;
if key<>#0 then fkeysgn:=1;
inherited keypress(key);
end;
[解决办法]
SelText是一框的文字(字符),Text是一框全部的文字(字符)。你上面的程式是用入字的。