Einzelnen Beitrag anzeigen

barf00s
(Gast)

n/a Beiträge
 
#2

Re: Problem eigene Komponenten miteinander verbinden

  Alt 7. Jun 2005, 10:13
Delphi-Quellcode:
unit MaxMySqlQuery;

interface

uses
  SysUtils, Classes,mysql,MaxMySqlCon;

type
  TMaxMySqlQuery = class(TComponent)
  private
    { Private-Deklarationen }
    FSource : TMaxMySqlCon;

  protected
    { Protected-Deklarationen }
    procedure Notification(AComponent: TComponent; Operation: TOperation);override;

  public
    { Public-Deklarationen }

  published
    { Published-Deklarationen }
    property Datasource : TMaxMySqlCon read FSource write FSource;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Samples', [TMaxMySqlQuery]);
end;

procedure TMaxMySqlQuery.Notification(Acomponent : TComponent; Operation: TOperation);
begin
   if (Operation = opRemove) and (AComponent is TMaxMySqlCon) then
      FSource := nil;
end;
end.
öhm
  Mit Zitat antworten Zitat