在ide环境下怎样双击控件进入设计窗体呢?
想在IDE环境下双击控件,设置控件有关属性 
就有点象TupdateSql控件一样,双击就可以进入设置属性SQL语句。

解决方案 »

  1.   

    就象fastreport一样,在设计时,可以双击控件进入设计报表啊
      

  2.   

    所以你应该可以在他的双击事件中写一些代码,这是我说的,
    因为双击事件始自TComponent;所以你可以在自己的控件中完成双击事件的编写
    而不是让用户来写,然后在里面调用你要的编辑器。参考而已
      

  3.   

    主要就是写一个TComponentEditor
    写个例子
    unit MyComponent;interfaceuses
      SysUtils, Classes, DesignEditors, DesignIntf, Controls;type
      TMyComponent = class(TComponent)
      private
        { Private declarations }
        FValue: string;
      protected
        { Protected declarations }
      public
        { Public declarations }
      published
        { Published declarations }
        property Value: string read FValue write FValue;
      end;  TMyComponentEditor = class(TComponentEditor)
      protected
        procedure ExecuteVerb(Index: Integer); override;
        function GetVerb(Index: Integer): string; override;
        function GetVerbCount: Integer; override;
      end;procedure Register;implementationuses Unit2;procedure Register;
    begin
      RegisterComponents('Samples', [TMyComponent]);
      RegisterComponentEditor(TMyComponent, TMyComponentEditor);
    end;{ TMyComponentEditor }procedure TMyComponentEditor.ExecuteVerb(Index: Integer);
    begin
      with TForm2.Create(nil) do
      try
        if ShowModal = mrOk then
        begin
          TMyComponent(Self.Component).Value := Edit1.Text;
          Self.Designer.Modified;
        end;
      finally
        Free;
      end;
    end;function TMyComponentEditor.GetVerb(Index: Integer): string;
    begin
      Result := 'Hello';
    end;function TMyComponentEditor.GetVerbCount: Integer;
    begin
      Result := 1;
    end;end.