(Moderator)
Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
Delphi 2006 Professional
|
Re: Label
17. Apr 2004, 16:06
So sollte es gehen
Delphi-Quellcode:
[...]
type
TOwnLabel = class(TLabel)
private
FChangeEvent: TNotifyEvent;
function FGetCaption: TCaption;
procedure FSetCaption(AValue: TCaption);
published
property Caption read FGetCaption write FSetCaption;
property OnChange: TNotifyEvent read FChangeEvent write FChangeEvent;
end;
[...]
implementation
function TOwnLabel.FGetCaption: TCaption;
begin
result := inherited Caption;
end;
procedure TOwnLabel.FSetCaption(AValue: TCaption);
begin
inherited Caption := AValue;
if Assigned(FChangeEvent) then FChangeEvent(Self);
end;
Jens Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
|