Add button to a StackPanel in code behind

Ribbon for WPF Forum

The latest build of this product (v22.1.4) was released 2 months ago, which was before this thread was created.
Posted 1 month 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 month 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

Add Comment

Please log in to a validated account to post comments.