Add button to a StackPanel in code behind

Ribbon for WPF Forum

Posted 1 year ago by mase
Version: 22.1.4
Avatar

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?

Thanks!

Comments (1)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

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 (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.