How can a WPF StackPanel fill vertically from bottom to top?

后端 未结 7 1608
灰色年华
灰色年华 2020-12-16 09:21

I need to be able to fill a stackpanel with buttons but the buttons must appear at the bottom of the stackpanel first and populate upwards<

相关标签:
7条回答
  • 2020-12-16 10:17

    Another alternative is to use a DockPanel instead.

    Just set the LastChildFill to false on the DockPanel.

    Then set the attached Dock property to each button you are adding to Bottom before adding to the DockPanel.

    example :

                var button = new Button();
                DockPanel.SetDock(button, Dock.Bottom);
    
    0 讨论(0)
提交回复
热议问题