天天看点

编写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

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