C
clwlyc
Unregistered / Unconfirmed
GUEST, unregistred user!
在我的控件里有一個對象類型屬性,定義如下:
type
TFillOptions=class(TPersistent)
private
FDirection:TFDirection;
FFillStyle:TFFillStyle;
FStartColor:TColor;
FEndColor:TColor;
procedure SetDirection(Value:TFDirection);
procedure SetFillStyle(Value:TFFillStyle);
function GetStartColor:TColor;
procedure SetStartColor(Value:TColor);
function GetEndColor:TColor;
procedure SetEndColor(Value:TColor);
public
procedure Assign(Source:TFillOptions);
procedure Change;
published
property Direction:TFDirection read FDirection write SetDirection;
property FillStyle:TFFillStyle read FFillStyle write SetFillStyle;
property StartColor:TColor read GetStartColor write SetStartColor;
property EndColor:TColor read GetEndColor write SetEndColor;
end;
{ TFillOptions }
procedure TFillOptions.Assign(Source: TFillOptions);
begin
if Source is TFillOptions then
begin
Direction:=TFillOptions(Source).Direction;
FillStyle:=TFillOptions(Source).FillStyle;
StartColor:=TFillOptions(Source).StartColor;
EndColor:=TFillOptions(Source).EndColor;
end;
end;
procedure TFillOptions.Change;
begin
end;
function TFillOptions.GetEndColor: TColor;
begin
Result:=FEndColor;
end;
function TFillOptions.GetStartColor: TColor;
begin
Result:=FStartColor;
end;
procedure TFillOptions.SetDirection(Value: TFDirection);
begin
FDirection:=Value;
Change;
end;
procedure TFillOptions.SetEndColor(Value: TColor);
begin
FEndColor:=Value;
Change;
end;
procedure TFillOptions.SetFillStyle(Value: TFFillStyle);
begin
FFillStyle:=Value;
Change;
end;
procedure TFillOptions.SetStartColor(Value: TColor);
begin
FStartColor:=Value;
Change;
end;
請問我如何在Change過程中調用控件的Invalidate來刷新控件?
type
TFillOptions=class(TPersistent)
private
FDirection:TFDirection;
FFillStyle:TFFillStyle;
FStartColor:TColor;
FEndColor:TColor;
procedure SetDirection(Value:TFDirection);
procedure SetFillStyle(Value:TFFillStyle);
function GetStartColor:TColor;
procedure SetStartColor(Value:TColor);
function GetEndColor:TColor;
procedure SetEndColor(Value:TColor);
public
procedure Assign(Source:TFillOptions);
procedure Change;
published
property Direction:TFDirection read FDirection write SetDirection;
property FillStyle:TFFillStyle read FFillStyle write SetFillStyle;
property StartColor:TColor read GetStartColor write SetStartColor;
property EndColor:TColor read GetEndColor write SetEndColor;
end;
{ TFillOptions }
procedure TFillOptions.Assign(Source: TFillOptions);
begin
if Source is TFillOptions then
begin
Direction:=TFillOptions(Source).Direction;
FillStyle:=TFillOptions(Source).FillStyle;
StartColor:=TFillOptions(Source).StartColor;
EndColor:=TFillOptions(Source).EndColor;
end;
end;
procedure TFillOptions.Change;
begin
end;
function TFillOptions.GetEndColor: TColor;
begin
Result:=FEndColor;
end;
function TFillOptions.GetStartColor: TColor;
begin
Result:=FStartColor;
end;
procedure TFillOptions.SetDirection(Value: TFDirection);
begin
FDirection:=Value;
Change;
end;
procedure TFillOptions.SetEndColor(Value: TColor);
begin
FEndColor:=Value;
Change;
end;
procedure TFillOptions.SetFillStyle(Value: TFFillStyle);
begin
FFillStyle:=Value;
Change;
end;
procedure TFillOptions.SetStartColor(Value: TColor);
begin
FStartColor:=Value;
Change;
end;
請問我如何在Change過程中調用控件的Invalidate來刷新控件?