AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Panelreheinfolge einhalten.

Ein Thema von Luckner · begonnen am 3. Aug 2016 · letzter Beitrag vom 9. Aug 2016
 
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#15

AW: Panelreheinfolge einhalten.

  Alt 3. Aug 2016, 21:19
Delphi-Quellcode:
unit Unit2;

interface

uses
  Vcl.Controls;

procedure ReAlignChildControls( AParentControl: TWinControl );

implementation

uses
  System.Types;

procedure ReAlignChildControls( AParentControl: TWinControl );
var
  lIdx : Integer;
  lBounds : TRect;
  lControl: TControl;
begin
  lBounds := AParentControl.ClientRect;

  for lIdx := 0 to AParentControl.ControlCount - 1 do
    begin
      lControl := AParentControl.Controls[ lIdx ];

      if not lControl.Visible
      then
        Continue;

      case lControl.Align of
        alTop:
          begin
            lControl.Top := lBounds.Top;
            lBounds.Inflate( 0, -lControl.Height, 0, 0 );
          end;
        alBottom:
          begin
            lControl.Top := lBounds.Bottom - lControl.Height;
            lBounds.Inflate( 0, 0, 0, -lControl.Height );
          end;
        alLeft:
          begin
            lControl.Left := lBounds.Left;
            lBounds.Inflate( -lControl.Width, 0, 0, 0 );
          end;
        alRight:
          begin
            lControl.Left := lBounds.Right - lControl.Width;
            lBounds.Inflate( 0, 0, -lControl.Width, 0 );
          end;
      end;
    end;
end;

end.
Die Ausrichtung erfolgt anhand der Z-Order (kann man über TControl.BringToFront oder TControl.SendToBack beeinflussen).
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  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 11:06 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz