TMSFNCToolBarPopup AutoSize

I have a popup with 3 buttons, but want to have the control resize according to the button visibility. Is this possible?

Hi,

This should all happen automatically. Can you post your code snippet you are using?

procedure TfrmMain.fncToolBarPopupActivate(Sender: TObject);
var
Parent: TTMSFNCTreeViewNode;

begin
fncToolBarPopup.Align := TAlignLayout.Vertical;
Parent := fncTreeView.GetParentNode(FInspectorNode);
case TBaseObject(Parent.DataObject).ObjectType of
otRadar: begin
fncToolBarPopup.Buttons[0].Visible := True;
fncToolBarPopup.Buttons[1].Visible := True;
fncToolBarPopup.Buttons[2].Visible := False;
end;
otQuarantine, otBackTest: begin
fncToolBarPopup.Buttons[0].Visible := False;
fncToolBarPopup.Buttons[1].Visible := False;
fncToolBarPopup.Buttons[2].Visible := True;
end;
end;

end;

You need to set the visibility of the buttons before activating the popup. Then the popup will automatically be resized. Also, The Alignment of the popup should not be set to make the auto-size work based on the number of visible buttons.

Thanks Pieter!