让你说的我也一头雾水了。Record是什么?是记录类型还是一条记录?怎么还“让他变成一个属性”?先说明白一些,大家好讨论。

解决方案 »

  1.   

    你自己看吧,一个演示,我编译通过了(D5)。
    unit Component1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
      TTestColor=(TestColor1,TestColor2,TestColor3);type
      TTestProp=set of TTestColor;type
      TComponent1 = class(TComponent)
      private
        { Private declarations }
        FTestColor:TTestProp;
        procedure SetTestColor(const Value: TTestProp);
      protected
        { Protected declarations }
        function FGetColor:TTestProp;
        procedure FSetColor(value:TTestProp);
      public
        { Public declarations }
      published
        { Published declarations }
        property TestColor:TTestProp read FTestColor write SetTestColor;
      end;procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('ActiveX', [TComponent1]);
    end;{ TComponent1 }function TComponent1.FGetColor: TTestProp;
    begin
      result:=FTestColor;
    end;procedure TComponent1.FSetColor(value: TTestProp);
    begin
      FTestColor:=value;
    end;procedure TComponent1.SetTestColor(const Value: TTestProp);
    begin
      FTestColor := Value;
    end;end.
      

  2.   

    在TypeLibraryEditor里有增加Method/Property的功能,其中Property有三种:只读,只写,读写。