Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi TBX Controls Create (https://www.delphipraxis.net/123510-tbx-controls-create.html)

ecHo89 3. Nov 2008 15:34


TBX Controls Create
 
Hi, ich will gerne ein DockablePanel erstellen (was klappt) und darauf ein AligmentPanel, worauf wieder eine ListBox ist.
Nur sehe ich nicht das AligmentPanel und die ListBox obwohl ich sie ausgerichtet habe. Was habe ich vergessen?

Delphi-Quellcode:
procedure TFormMain.TBXItem30Click(Sender: TObject);
begin
  if TBXItem30.Checked then
  begin
   TBXDockablePanel4.Destroy;
   TBXItem30.Checked := false;
  end
  else
  begin
   TBXDockablePanel := TTBXDockablePanel.Create(self);
   with TBXDockablePanel do
   begin
    inc(p);
    Name := 'TBXDockablePanel' // + inttostr(p); ? klappt mit beidem nicht
    Caption := ' Andere Applikationen';
    CurrentDock := TBXMultiDock7;
    CaptionRotation := dpcrAlwaysHorz;
   end;
   TBXAlignmentPanel := TTBXAlignmentPanel.Create(TBXDockablePanel);
   with TBXAlignmentPanel do
   begin
    Align := alClient;
    Margins.Bottom := 3;
    Margins.Left := 3;
    Margins.Right := 3;
    Margins.Top := 3;
   end;
   ListBox := TListBox.create(TBXAlignmentPanel);
   with ListBox do
   begin
    Align := alClient;
   end;
   TBXItem30.Checked := true;
  end;
end;
PS: Wenn sich jemand mit TBX auskennt:
Wie kann ich verhindern, dass mehrere DockablePanels sich in eine Zeile reihen? (D.h. mehrer Spalten dann bilden, bei mir irgendwie maximal 2, aber möchte maximal 1)

Danke!

DeddyH 3. Nov 2008 15:37

Re: TBX Controls Create
 
Delphi-Quellcode:
with TBXAlignmentPanel do
   begin
     Parent := TBXDockablePanel;//<--
     Align := alClient;
     Margins.Bottom := 3;
     ...
Hth

ecHo89 3. Nov 2008 15:44

Re: TBX Controls Create
 
hmm, dachte ich hätte das durch die Klammer(x) schon erledigt.
Da kann man auch Self reinschreiben und trotzdem funktioniert es. Aber dachte es würde reichen, wenn es in der Klammer beim Aufruf stehen würde.

Delphi-Quellcode:
 TBXAlignmentPanel := TTBXAlignmentPanel.Create(self);
   with TBXAlignmentPanel do
   begin
    Parent := TBXDockablePanel;

DeddyH 3. Nov 2008 15:45

Re: TBX Controls Create
 
Nicht Parent und Owner verwechseln.

ecHo89 3. Nov 2008 16:07

Re: TBX Controls Create
 
ahja besser wärs :-)
gut hab als owner jezt wieder self


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:58 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