我照着资料,想实现在'Samples'面板上添加一个,自编的Tmyedit控件。
我用install component 和 new component都不行,dclusr.dpk中有Tmyedit.pas但是面板上就是没有,请问我该怎么办?
我用install component 和 new component都不行,dclusr.dpk中有Tmyedit.pas但是面板上就是没有,请问我该怎么办?
调试欢乐多
myedit.pas 如下:
unit myedit;interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls;
type
Tmyedit = class(TEdit)
private
protected
procedure wndproc( var message:Tmessage);override;
public
published
end;
procedure register;
implementation
procedure register;
begin
RegisterComponents('Samples', [Tmyedit]);
end;
procedure Tmyedit.wndproc(var message:Tmessage);
begin
case message.Msg of
wm_mousemove :begin
cursor:=crarrow;
exit;
end;
wm_SetFocus : exit;
else
inherited wndproc(message);
end; end;
end.
begin
RegisterComponents('Samples', [Tmyedit]);
end;