Registriert seit: 15. Jun 2010
Ort: Augsburg Bayern Süddeutschland
3.470 Beiträge
Delphi XE3 Enterprise
|
AW: TCategoryPanel einklappen/ausklappen Align-Ausrichtung
19. Jun 2012, 14:03
Delphi-Quellcode:
procedure TForm5.ReMeasureCat;
var
coll,SplitHeight, I:Integer;
begin
coll := 0;
for I := 0 to CategoryPanelGroup1.ControlCount-1 do
if CategoryPanelGroup1.Controls[i] is TCategoryPanel then
if TCategoryPanel(CategoryPanelGroup1.Controls[i]).Collapsed then inc(coll);
if coll<CategoryPanelGroup1.ControlCount then
begin
SplitHeight := (CategoryPanelGroup1.Height - coll*30) div (CategoryPanelGroup1.ControlCount-coll);
for I := 0 to CategoryPanelGroup1.ControlCount-1 do
if CategoryPanelGroup1.Controls[i] is TCategoryPanel then
if not TCategoryPanel(CategoryPanelGroup1.Controls[i]).Collapsed then TCategoryPanel(CategoryPanelGroup1.Controls[i]).Height := SplitHeight;
end;
end;
procedure TForm5.CategoryPanel3Collapse(Sender: TObject);
begin
ReMeasureCat;
end;
procedure TForm5.CategoryPanel3Expand(Sender: TObject);
begin
ReMeasureCat;
end;
Thomas Wassermann H₂♂ Das Problem steckt meistens zwischen den Ohren
DRY DRY KISS
H₂♂ (wenn bei meinen Snipplets nichts anderes angegeben ist Lizenz: WTFPL)
|