海天一线 发表于 2005-3-5 21:43

[讨论][原创]有个问题,先谢谢大家了!

用DELPHI编程时,加入一个edit栏,我想控制它输入的数字不能相同,请问要怎么做![em06]

ysp_1984 发表于 2006-4-25 11:15

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);<BR>var<BR>i:integer;<BR>str:string;<BR>begin<BR> str:=edit1.text;<BR> for i:=1 to length(str) do<BR>  begin<BR>   if key=str[i] then key:=#0;<BR>  end;<BR>end;

zhou 发表于 2008-3-30 17:51

*** 作者被禁止或删除 内容自动屏蔽 ***

页: [1]

编程论坛