Delphi 如何在另一个面板的右侧设置面板?

Delphi 如何在另一个面板的右侧设置面板?,delphi,panel,toolbar,vcl,delphi-10.4-sydney,Delphi,Panel,Toolbar,Vcl,Delphi 10.4 Sydney,我想在模式的“Panel3”右侧设置一个“Panel2”,当“Panel2”隐藏“Panel3”时,“Panel2”仍然可以再次显示“Panel3”。到目前为止,我所拥有的一切是: procedure TForm1.FormCreate(Sender: TObject); begin Panel2.Parent := Self; Panel2.Anchors := [akLeft, akTop, akBottom]; Panel2.Caption := '>>>';

我想在模式的“
Panel3
”右侧设置一个“
Panel2
”,当“
Panel2
”隐藏“
Panel3
”时,“
Panel2
”仍然可以再次显示“
Panel3
”。到目前为止,我所拥有的一切是:

procedure TForm1.FormCreate(Sender: TObject);
begin
  Panel2.Parent := Self;
  Panel2.Anchors := [akLeft, akTop, akBottom];
  Panel2.Caption := '>>>';
  Panel2.ParentBackground := False;
  Panel2.SetBounds(0, Panel1.Height, 30, 20);

  Panel3.Parent := Self;
  Panel3.Anchors := [akLeft, akTop, akBottom];
  Panel3.Caption := '';
  Panel3.Color := $0000F9FF;
  Panel3.ParentBackground := False;
  Panel3.Visible := False;
  Panel3.SetBounds(0, Panel1.Height + Panel2.Height, 100, ClientHeight);
end;

procedure TForm1.Panel2Click(Sender: TObject);
begin
  if Panel2.Caption = '>>>' then
  begin
    AnimateWindow(Panel3.Handle, 150, AW_ACTIVATE or AW_SLIDE or AW_HOR_POSITIVE);
    Panel2.Caption := '<<<';
  end
  else if Panel2.Caption = '<<<' then
  begin
    AnimateWindow(Panel3.Handle, 150, AW_HIDE or AW_SLIDE or AW_HOR_NEGATIVE);
    Panel2.Caption := '>>>';
  end;
end;
过程TForm1.FormCreate(发送方:TObject);
开始
2.父母:=自己;
面板2.锚定:=[akLeft、akTop、akBottom];
面板2.标题:='>>>';
Panel2.ParentBackground:=假;
镶板2.立根(0,镶板1.高度,30,20);
3.父母:=自己;
面板3.锚定:=[akLeft、akTop、akBottom];
面板3.标题:='';
面板3.颜色:=$0000F9FF;
Panel3.ParentBackground:=假;
面板3.可见:=假;
面板3.立根(0,面板1.高度+面板2.高度,100,倾斜高度);
结束;
程序TForm1.Panel2Click(发送方:TObject);
开始
如果Panel2.Caption='>>>,则
开始
动画窗口(面板3.Handle,150,AW_激活或AW_滑动或AW_HOR_阳性);

Panel2.标题:='
Panel2.左:=Panel3.宽度
?@SertacAkyuz,是的!谢谢。看来你正在重新创建一个
TCategoryPanelGroup