So schwer ist das eigentlich nicht.
Delphi-Quellcode:
try
TSimpleLabeledEdit = class(TLabeledEdit)
private
class var
FDefaultFontName: String;
FDefaultFontSize: Integer;
public
class property DefaultFontName: String read FDefaultFontName write FDefaultFontName;
class property DefaultFontSize: Integer read FDefaultFontSize write FDefaultFontSize;
constructor Create(AOwnerAndParent: TWinControl; ALeft, ATop, AWidth: Integer; ACaption: String; AVisible: Boolean = True);
end;
constructor TSimpleLabeledEdit.Create(AOwnerAndParent: TWinControl; ALeft, ATop, AWidth: Integer; ACaption: String; AVisible: Boolean = True);
begin
inherited Create(AOwnerAndParent); //den originalen Constructor aufrufen
Parent:=AOwnerAndParent;
Left:=ALeft;
Top:=ATop;
Width:=AWidth;
EditLabel.Caption:=ACaption;
Font.Name:=FDefaultFontName;
EditLabel.Font.Name:=FDefaultFontName;
Font.Size:=FDefaultFontSize;
EditLabel.Font.Size:=FDefaultFontSize;
Visible := AVisible; //Show bzw. Hide
end;
Und nun einfach TSimpleLabeledEdit verwenden.