我的环境:Windows 7 Pro(32位)上的RadStudio XE4.
Difference between property and function or procedures
在上面的Q和A中,有一个回复说
“更具体地说,如果使用Delphi IDE进行编程,您将看到已发布的属性(-yies)将显示在Object Inspector中”.
我试过这个.
unit Unit1; interface uses Winapi.Windows,Winapi.Messages,System.SysUtils,System.Variants,System.Classes,Vcl.Graphics,Vcl.Controls,Vcl.Forms,Vcl.Dialogs; type TForm1 = class(TForm) private FSampleProp1: Integer; function GetSampleProp1(): Integer; procedure SetSampleProp1(val: Integer); { Private declaration } published { Private declaration } property SampleProp1: Integer read GetSampleProp1 write SetSampleProp1; end;
我希望在Object Inspector的“property”选项卡中有“SampleProp1”.但我没有那个.
相反,我在[Delphi Class Exploroer]“窗口中有”SampleProp1“.
我是否在Object Inspector中拥有已发布的属性是不正确的?