我照着资料,想实现在'Samples'面板上添加一个,自编的Tmyedit控件。
我用install component 和 new component都不行,dclusr.dpk中有Tmyedit.pas但是面板上就是没有,请问我该怎么办?

解决方案 »

  1.   

    dclusr.dpk中有myedit.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.
      

  2.   

    procedure register;
       begin
         RegisterComponents('Samples', [Tmyedit]);
       end;
      

  3.   

    同意1楼,打开工程dclusr.dpk,点compile,编译成功,应该就有了