你需要的是ComponentEditor还是PropertyEditor?其实{$Delphi}\Source下有一堆PropertyEditor的源码。

解决方案 »

  1.   

    D5DG,D6DG都有简单的sample。你可以参考一下。
      

  2.   

    {
    Copyright ?1999 by Delphi 5 Developer's Guide - Xavier Pacheco and Steve Teixeira
    }
    unit CompEdit;interfaceuses
      SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
      DsgnIntf;type
      TComponentEditorSample = class(TComponent)
      protected
        procedure SayHello; virtual;
        procedure SayGoodbye; virtual;
      end;  TSampleEditor = class(TComponentEditor)
      public
        procedure ExecuteVerb(Index: Integer); override;
        function GetVerb(Index: Integer): string; override;
        function GetVerbCount: Integer; override;
      end;implementation{ TComponentEditorSample }procedure TComponentEditorSample.SayHello;
    begin
      MessageDlg('Hello, there!', mtInformation, [mbOk], 0);
    end;procedure TComponentEditorSample.SayGoodbye;
    begin
      MessageDlg('See ya!', mtInformation, [mbOk], 0);
    end;{ TSampleEditor }const
      vHello = 'Hello';
      vGoodbye = 'Goodbye';procedure TSampleEditor.ExecuteVerb(Index: Integer);
    begin
      case Index of
        0: TComponentEditorSample(Component).SayHello;    // call function
        1: TComponentEditorSample(Component).SayGoodbye;  // call function
      end;
    end;function TSampleEditor.GetVerb(Index: Integer): string;
    begin
      case Index of
        0: Result := vHello;       // return hello string
        1: Result := vGoodbye;      // return goodbye string
      end;
    end;function TSampleEditor.GetVerbCount: Integer;
    begin
      Result := 2;      // two possible verbs
    end;end.
      

  3.   

    那你自己做个Form好了,调用的时候ShowModal,记得把Component传给Form,这样可以修改控件的属性。
      

  4.   

    我就是不知道怎么传这个Component才问的,如果知道就不问啦,你既然知道就给我一些代码吧,你帮了我不少忙,我十分感谢,这次也帮到底吧!
      

  5.   

    这是常用的技术啊,Sample:
    TYourForm = class(TForm)
    ...
    public
      YourComponent: TYourComponent;
    end;procedure ShowYourForm(AYourComp: TYourComponent);
    begin
      with TYourForm.Create(nil) do
      try
        YourComponent := AYourComp;
        ShowModal;
      finally
        Free
      end;
    end;
    end;