我新建了一个类
可视化的
类是一个Panel
panel上有个Label
我想跟Label加一个方法
可视程序一直报错,望大虾们指点
TEditConvertType = class (TPanel)
private
{ Private declarations }
protected
{ Protected declarations }
public
Lable4:TLabel;
Constructor Create(AOwner:TComponent); override;
procedure iii;
published
{ Published declarations }
end;Constructor TEditConvertType.Create(AOwner:TComponent);
begin
Inherited Create(AOwner);
Height:=114;
Left:=56;
Top:=16;
Width:=593;
//定义组件的位置
Lable4:=Tlabel.Create(self);
Lable4.Parent:=self;
Lable4.Caption:='Edit';
Lable4.Height:=13;
Lable4.Left:=432;
Lable4.Top:=28;
Lable4.Width:=81;
Lable4.OnMouseMove:=iii;//此处报错
//定义Edit字段
end; procedure TEditConvertType.iii ;
begin
showmessage('ssss');
end;
可视化的
类是一个Panel
panel上有个Label
我想跟Label加一个方法
可视程序一直报错,望大虾们指点
TEditConvertType = class (TPanel)
private
{ Private declarations }
protected
{ Protected declarations }
public
Lable4:TLabel;
Constructor Create(AOwner:TComponent); override;
procedure iii;
published
{ Published declarations }
end;Constructor TEditConvertType.Create(AOwner:TComponent);
begin
Inherited Create(AOwner);
Height:=114;
Left:=56;
Top:=16;
Width:=593;
//定义组件的位置
Lable4:=Tlabel.Create(self);
Lable4.Parent:=self;
Lable4.Caption:='Edit';
Lable4.Height:=13;
Lable4.Left:=432;
Lable4.Top:=28;
Lable4.Width:=81;
Lable4.OnMouseMove:=iii;//此处报错
//定义Edit字段
end; procedure TEditConvertType.iii ;
begin
showmessage('ssss');
end;
procedure III(Shift: TShiftState; X, Y: Integer); procedure III(Shift: TShiftState; X, Y: Integer);
begin
showmessage('ssss');
end;
TAP = Class(TDevice) //网管接入点类继承自TDevice
Timer:TTimer;
private
FConnected:Boolean;
procedure SetTimeOut(value:Cardinal);
function GetTimeOut:Cardinal;
procedure TimeronTimer(Sender: TObject);
public
property APType; // 单机型的或者集中式的
property DeviceType;
property DeviceIP;
property DeviceName;
property DeviceSign;
property TimeOut:Cardinal read GetTimeOut write SetTimeOut;
property Connected:Boolean read FConnected write Fconnected;
{定义一些函数}
procedure AlarmCheck; //查询告警信息:命令编号10
procedure APCheck; //网管接入点参数查询20
procedure SlotCheck; // 集中型插槽使用查询
procedure APSet(APSytle:byte;APsign,APname,APIP,CenterIP,gateIP,maskIP,Mac,GAPsign:string;set1:byte);
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
-------------------------------------
constructor TAP.Create(AOwner: TComponent);
begin
inherited;
self.DeviceType:=1;
self.Glyph:=frmMain.ICOAP.Picture.Bitmap;{定义图标}
self.OnMouseDown:=frmMain.APMouseDown; {定义一些鼠标动作}
self.OnMouseMove:=frmMain.APMouseMove;
self.OnMouseUp:=frmMain.APMouseUp;
self.PopupMenu:=frmMain.PopupMenu1;
{对于timer的某些设置}
timer:=TTimer.Create(self);
timer.OnTimer:=self.TimeronTimer;
timer.Enabled:=False;
timer.Interval:=1000;
{设定为未连接状态}
self.Connected:=False;
end;destructor TAP.Destroy;
begin
timer.Free;
inherited;
end;