Add button to a StackPanel in code behind

Ribbon for WPF Forum

Posted 9 months ago by mase
Version: 22.1.4

I would like to add a button in the code behind to a ribbon group.
MyRibbonGrp.Items.Add(new Button());
That also works wonderfully.

However, I would like to add the button to a StackPanel so that it is added small (AlwaysSmall).
A stack panel does not have an Items.Add() method. Can someone help me with this?


Comments (1)

Posted 9 months ago by Actipro Software Support - Cleveland, OH, USA


StackPanel inherits Panel, so you can call the stackPanel.Children.Add() method to add the button.

Actipro Software Support

The latest build of this product (v23.1.3) was released 17 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.