我在窗口中动态建立了一个编辑框的数组.但是要怎么在这些编辑框中禁止输入英文字符.也就是说只能输入数字.
解决方案 »
- 请问Delphi7程序发布的问题
- 使用过TmxOutlookBarPro控件的人员提问?请见问题
- BDE连结sybase为什么有时会出现连不上sybase?打不中表呢?
- 请问在rave怎么把bit型的数值打印成图案或其他方式啊???(默认是true和false)
- 请大家做一个数学的组合排列题
- DLL调用的问题
- 如何判断DBGRID中各字段的类型?
- 谁有htmlreport的正式版控件?
- 求教合计问题~~~急!!!!!!!!!
- C/S结构下配置socketconnect的问题?
- 我怎样在钩子程序里面得到键盘的值.我很迷茫?
- 各位网友,那位知道有一个专门讨论BusinessSkinForm的专门论坛?谢谢!
if not ( Key in ['0'..'9'] ) then
Key = #0;
if not ( Key in ['0'..'9','.',#8] ) then
Key := #0;
如:EditArray[0].OnClick = EditOnKeyDown();然后再自定义事件EditOnKeyDown就OK了
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TEdt =class(TEdit)
procedure KeyDown1(Sender: TObject; var Key: Char);
end;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
edt1 :tedt;
implementation{$R *.dfm}procedure TEdt.KeyDown1(Sender: TObject; var Key: Char);
begin
if not ( Key in ['0'..'9','.',#8] ) then
Key := #0;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
edt1:=tedt.Create(self);
edt1.Parent :=form1;
edt1.OnKeyPress :=edt1.KeyDown1;
end;
end.应该没问题了吧!!!!