My environment: RadStudio XE4 on Windows 7 Pro (32bit).
Difference between property and function or procedures
In the above Q and A, there is a reply saying
"More concretely, if you use the Delphi IDE to program, you will see that the published property (-y+ies) will show up in the Object Inspector".
I tried this.
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;
I expected that I would have "SampleProp1" in the "property" tab of the Object Inspector. But I do not have that one.
Instead, I had the "SampleProp1" in the [Delphi Class Exploroer]" windows.
Is it incorrect that I would have the published property in the Object Inspector?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…