Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mi 11.09.02 21:13 
Hi,

hab mal ne Frage.. ich benutze für fast alle meine Komponenten das TCustomControl.

Jetzt wollte ich mal fragen, wenn ich auf ein TCustomControl in Delphi dann z.B. ein TLabel draulege verschwindet es hinter dem CustomControl... wenn ich meine Kompo von einem TPanel ableite klappt alles super. Kann ich das TCustomControl irgendwie so hinbekommen das es wie das TPanel funktioniert (Also ein Label auf und nicht hinter ihm landet)??

und das ich nich vom TPanel ableite liegt daran, da das TPanel zuviele dinge beinhaltet die ich garnicht brauche/verwenden kann... oder kann ich Propertys auch unterbinden???

Au'revoir,
Aya
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 12.09.02 10:34 
Hallo,

das tPanel ist ja auch von tCustomControl abgeleitet. Ein Blick in die Sourcen und mir ist folgendes aufgefallen: Im Constructor des tPanel steht das hier:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
constructor TCustomPanel.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
    csSetCaption, csOpaque, csDoubleClicks, csReplicatable];
  {...}
end;

Füge mal (wie oben) in Deinen Komponenten csAcceptsControls dem Property ControlStyle hinzu. Vielleicht klappt es ja dann!

Gruß
TINO
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 12.09.02 18:10 
Danke~~~

hat geklappt *frooi*