我把它install了一下结果看不见,是我的代码有问题吗
代码如下:哪位大侠救救我
unit QZXEdit;interfaceuses
Windows, Messages, SysUtils, Classes, QControls, QStdCtrls;type
TInputType=(cString,cInteger,cFloat,cMoney);
TZXEdit = class(TEdit)
private
{ Private declarations }
FInputType:TInputType;
protected
{ Protected declarations }
procedure KeyPress(var Key: Char); override;
public
{ Public declarations }
published
{ Published declarations }
property InputType:TInputType read FinputType write FinputType Default cstring;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('ZXControl', [TZXEdit]);
end;{ TZXEdit }procedure TZXEdit.KeyPress(var Key: Char);
begin
inherited;
if FInputType=cInteger then
begin
if (Key<'0') or (Key>'9') then
begin
if Key>Chr(26) then
begin
Key:=Chr(0);
end;
end;
end;
end;end.
代码如下:哪位大侠救救我
unit QZXEdit;interfaceuses
Windows, Messages, SysUtils, Classes, QControls, QStdCtrls;type
TInputType=(cString,cInteger,cFloat,cMoney);
TZXEdit = class(TEdit)
private
{ Private declarations }
FInputType:TInputType;
protected
{ Protected declarations }
procedure KeyPress(var Key: Char); override;
public
{ Public declarations }
published
{ Published declarations }
property InputType:TInputType read FinputType write FinputType Default cstring;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('ZXControl', [TZXEdit]);
end;{ TZXEdit }procedure TZXEdit.KeyPress(var Key: Char);
begin
inherited;
if FInputType=cInteger then
begin
if (Key<'0') or (Key>'9') then
begin
if Key>Chr(26) then
begin
Key:=Chr(0);
end;
end;
end;
end;end.
解决方案 »
- 我想在delphi7中如何使用fastmm4,怎么做呢?
- 在delphi中如果写存储过程或者函数!!
- 一个字符串问题
- 求本地数据提交的WEB后台数据库的最好方法
- 我看到一个第三方控件中用.inc文件,打开一看跟.pas文件没有什么差别,为什么不直接用.pas文件?
- DBLookupComboBox的问题
- 关于AnimateWindow的用法。
- 我用d5adoupgrade升级ADO,安装好了后,运行DELPHI,出错提示不能找到程序入口,为什么?请帮帮小弟呢,我编好的程序,由于TADOQUERY的BUG不能运行。赐教。
- 关于TNMUDP component的sendstream问题
- matlab导入一个图片,点击不同位置产生坐标矩阵
- 怎样制作向导(wizzard)?
- 所谓动态查询是指什么?
后来什么方法都试了,还是不行!
begin
RegisterComponents('Samples', [TTest]);
RegisterComponents('Samples', [TMyImgPanel]);
end;
RegisterComponents('ZXControl', [TZXEdit]);
兄弟我当然注册了呀