Registriert seit: 17. Jan 2006
368 Beiträge
Delphi 2009 Professional
|
AW: Kompenente erweitern - eigene Property immer leer
16. Jun 2010, 13:51
Hi,
ich dachte das die setter / getter optional sind...zu anfangs hatte ich es so:
Delphi-Quellcode:
unit DBRichEditExt;
interface
uses
SysUtils, Classes, Controls, StdCtrls, ComCtrls, DBCtrls, Graphics, ExtCtrls,
Dialogs, Forms, Windows;
type
TDBRichEditExt = class(TDBRichEdit)
private
{ Private-Deklarationen }
FCaption : String;
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
procedure setCaption(value : string);
function getCaption() : string;
published
{ Published-Deklarationen }
property Caption: String read getCaption write setCaption;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents(' Samples', [TDBRichEditExt]);
end;
constructor TDBRichEditExt.Create(AOwner: TComponent);
begin
inherited;
showmessage(FCaption); // immer leer?
end;
procedure TDBRichEditExt.setCaption(value : string);
begin
if value <> FCaption then
FCaption := value;
end;
function TDBRichEditExt.getCaption() : string;
begin
result := FCaption;
end;
end.
Geändert von SirThornberry (16. Jun 2010 um 14:04 Uhr)
Grund: Code-Tags durch Delphi-Tags ersetzt - nächstes mal bitte selbst machen.
|
|
Zitat
|