AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi EntwZeit - Subkomponente löschen - Exception wird ausgelöst
Thema durchsuchen
Ansicht
Themen-Optionen

EntwZeit - Subkomponente löschen - Exception wird ausgelöst

Ein Thema von christian_r · begonnen am 3. Mai 2008 · letzter Beitrag vom 4. Mai 2008
 
christian_r
(Gast)

n/a Beiträge
 
#8

Re: EntwZeit - Subkomponente löschen - Exception wird ausgel

  Alt 3. Mai 2008, 13:41
Delphi-Quellcode:
unit DkComponent;

interface

uses
  Classes, StdCtrls;

type
  TDkComponent = class( TComponent )
   private
    FComboBox : TComboBox;
   protected
    procedure Notification
              ( pComponent : TComponent; pOperation : TOperation );
              reintroduce;
              virtual;
   published
    property ComboBox
              : TComboBox
              read FComboBox
              write FComboBox;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents( 'Test', [ TDkMailAccount ] );
end;

{ TDkComponent }
procedure TDkComponent.Notification
          ( pComponent : TComponent; pOperation : TOperation );
begin
  inherited Notification( pComponent, pOperation );
  if ( pOperation = opRemove )
     and ( FComboBox <> nil )
     and ( pComponent = Self.ComboBox ) then
    Self.ComboBox := nil;
end;

end.
Jetzt funktioniert das Löschen ohne Exception. Und die geebrte "Notifcation" werde ich mir noch mal ganz in Ruhe ansehen. Man kann ja nur daraus lernen.

Wirklich vielen Dank für die Unterstützung.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:30 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz