AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi [Komponentenentwicklung] Problem mit Subkomponenten
Thema durchsuchen
Ansicht
Themen-Optionen

[Komponentenentwicklung] Problem mit Subkomponenten

Ein Thema von HalloDu · begonnen am 23. Sep 2006 · letzter Beitrag vom 24. Sep 2006
Antwort Antwort
Benutzerbild von Sunlight7
Sunlight7

Registriert seit: 17. Sep 2006
Ort: Sonnensystem, Zentral
1.522 Beiträge
 
Delphi 5 Standard
 
#1

Re: [Komponentenentwicklung] Problem mit Subkomponenten

  Alt 24. Sep 2006, 20:18
Und welche Richtung?

Oder meinst Du so etwas?

Delphi-Quellcode:
type
  TMyControl = class(TCustomControl)
  private
    MySubControl:TCustomControl;
  public
    constructor Create(AOwner:TComponent); override;
    destructor Destroy; override;
  end;

...

constructor TMyControl.Create(AOwner:TComponent);
begin
   inherited Create(AOwner);

   Width:=100;
   Height:=100;
   Color:=clRed;

   MySubControl:=TCustomControl.Create(Self);
   With MySubControl do begin
      Parent:=Self;
      Brush.Color:=clLime;
      SetBounds(25, 25, 50, 50);
      Visible:=True;
   end;
end;

destructor TMyControl.Destroy;
begin
   MySubControl.Free;

   inherited Destroy;
end;
PS: TGraphicControl kann nicht als Parent verwendet werden (korrigiert mich falls das nicht stimmt)
MySubControl könnte aber eine TGraphicControl ableitung sein.
Windows: Ja - Microsoft: Nein -> www.ReactOS.org
  Mit Zitat antworten Zitat
Antwort Antwort


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 12:17 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