1. 所有的edit 都只允?s??入?底郑?即只可以??入一次小?迭c
2. 不想?χ噙_?资???的edit 都??onkeypress 事件
那你就??一??,其它的全部在object inspector 中指向?@一??:
procedure tform1.edit1keypress(sender: tobject; var key: char);
var
intcompidx: integer;
sttext: string;
begin
if (ord(key) = 46) then
begin
intcompidx := (sender as tedit).componentindex;
sttext := tedit(components[intcompidx]).text;
if pos(., sttext) > 1 then
key := #0;
end;
end;
如果不?x得?y看的??也可以不用??量:
if (ord(key) = 46) and
(pos(., tedit(components[(sender as tedit).componentindex]).text) > 1)then
key := #0;
