天天看點

編寫Delphi控件屬性Stored和Default的了解及應用

property ButtonSize: Integer read FButtonSize write SetButtonSize default 0;

    property Color: TColor read FColor write SetColor default clBtnHighlight;

    property Increment: TScrollBarInc read FIncrement write FIncrement stored IsIncrementStored default 8;

    property Margin: Word read FMargin write FMargin default 0;

    property ParentColor: Boolean read FParentColor write SetParentColor default True;

    property Position: Integer read FPosition write SetPosition default 0;

    property Range: Integer read FRange write SetRange stored IsRangeStored default 0;

    property Smooth: Boolean read FSmooth write FSmooth default False;

    property Size: Integer read FSize write SetSize default 0;

    property Style: TScrollBarStyle read FStyle write SetStyle default ssRegular;

    property ThumbSize: Integer read FThumbSize write SetThumbSize default 0;

    property Tracking: Boolean read FTracking write FTracking default False;

    property Visible: Boolean read FVisible write SetVisible default True;

這是類TControlScrollBar中的屬性定義,其中的Range屬性中存在stored IsRangeStored定義。

 先說一下這個指令的文法:stored 後面加一個Boolean類型的變量聲明,例如stored False 或 stored true

上一篇: 堆排序
下一篇: 希爾排序