was auch noch geht:
Delphi-Quellcode:
TMyNewClass = TComponent
private
fClientSocket: TClientSocket;
procedure fSetActive(AValue: Boolean);
function fGetActive: Boolean;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
//place here the properties you wish to use from fClientSocket outside this class
property Active: Boolean read fGetActive write fSetActive;
end;
constructor TMyNewClass.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fClientSocket := TClientSocket.Create(Self);
end;
destructor TMyNewClass.Destroy;
begin
fClientSocket.Free;
inherited Destroy;
end;
procedure TMyNewClass.fSetActive(AValue: Boolean);
begin
fClientSocket.Active := AValue;
end;
function TMyNewClass.fGetActive: Boolean;
begin
result := fClientSocket.Active;
end;
Also einfach in einer neuen klasse, private die gewünschte klasse erstellen und dann die methoden die man public haben will durch eigene Methoden bereit stellen