我把它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.
解决方案 »
- 如何改变标题栏的的颜色
- 刚刚开始学习Delphi,谁介绍几本好书,最好有下载地址?将来想做工控方面的,这方面的也提供一些,先谢谢了
- 100分求高人指点!delphi7自带demo的代码有些麻烦,不是很懂,解决后马上给分!
- DLL出现错误,“无法定位程序输入点ConnRs于动态链接库ConnRs.DLL”
- INI文件问题?
- 这段存储过程怎么写?如果SQL-server的数据库中不存在数据表A就建立它.
- 怎样查找某个进程并终止它的运行
- 如何将鼠标的图形改变成自定义的图形
- 控件高手帮忙:如何实现属性重的下拉框
- ====delphi5怎么连接Access2000数据库?===
- 怎样制作向导(wizzard)?
- 所谓动态查询是指什么?
后来什么方法都试了,还是不行!
begin
RegisterComponents('Samples', [TTest]);
RegisterComponents('Samples', [TMyImgPanel]);
end;
RegisterComponents('ZXControl', [TZXEdit]);
兄弟我当然注册了呀