Group TAdvSmoothExpanderPanel

I have a panel with 3 TAdvSmoothExpanderPanels.
2 are closed and 1 is expanded.
If I now click on a closed one, it should expand and the expanded one should be closed. The expanded one should always be align = alClient.
Is that possible and if so how.

Thank you and have a nice time
Mike

There is at this moment not a built-in way to do this.
In order to override the built-in expand/collapse to handle this, we need to expose an extra event.
In the next update, there will be the OnExpandCollapseChange event that you can then implement this way to achieve this (same event handlers for all panels you want to have this behavior for):

const
  PANELCLOSEDHEIGHT = 25;

procedure TForm1.AdvSmoothExpanderPanel1ExpandCollapseChange(Sender: TObject;
  AExpanded: Boolean; var DefaultProcessing: Boolean);
var
  h,i: integer;
begin
  DefaultProcessing := false;

  h := 0;
  for i := 0 to ControlCount - 1 do
  begin
    if Controls[i] is TAdvSmoothExpanderPanel then
    begin
      TAdvSmoothExpanderPanel(Controls[i]).ExpandedState := false;
      TAdvSmoothExpanderPanel(Controls[i]).ExpandedHeight := PANELCLOSEDHEIGHT;
      TAdvSmoothExpanderPanel(Controls[i]).Height := PANELCLOSEDHEIGHT;
      h := h + PANELCLOSEDHEIGHT;
    end;
  end;

  if AExpanded then
  begin
    TAdvSmoothExpanderPanel(Sender).ExpandedState := true;
    TAdvSmoothExpanderPanel(Sender).ExpandedHeight := ClientHeight - h;
    TAdvSmoothExpanderPanel(Sender).Height := ClientHeight - h;
  end;
end;

This event will be added in the next TMS VCL UI Pack update.

Fine, thanks for the fast response.
Another idea. a group. then you can control the behavior of a group.

I solved it like this now:

procedure sep_CategoryEndExpandPanel(Sender: TObject);
start
if not cb_Panel.Checked then
start
cb_Panel.Checked:= true;
p_panel.Text:= '1';
Panel_expander(1);
end;
end;

procedure Panel_expander(byPanel: byte);
start
if p_panel.Text = '1' then
start
sep_project.Expanded:= false;
sep_Employees.Expanded:= false;
sep_employees.Align:=alBottom;
sep_project.Align:=alBottom;
sep_Category.Align:=alClient;
end;
if p_panel.Text = '2' then
start
sep_project.Expanded:= false;
sep_Category.Expanded:= false;
sep_category.Align:=altop;
sep_project.Align:=alBottom;
sep_Employees.Align:=alClient;
end;
cb_Panel.Checked:= false;
end;

Thank you and have a happy and healthy new year

Mike