-1

I've been looking almost all night for a way to have this nice "add" button at the bottom of a ListBox. The thing is I want it to stick at the bottom of the listbox, and then once the bottom of the border is reached, I want the listbox to become scrollable so that the add button doesn't get out of the border. Right now I do it with two rows but I would like the button to be precisely at the bottom of the list, while still not going out of the border when the list grows bigger. Any Idea ? Thanks in advance

Marcel Barc
  • 137
  • 1
  • 9

1 Answers1

-1

Okay so I finally found my way through this simple yet annoying thing : The trick was to use a DockPanel and put the button at the bottom, while having all the controls vertically aligned to the top.

<DockPanel Height="Auto" VerticalAlignment="Top">
    <Button Width="20" DockPanel.Dock="Bottom" VerticalAlignment="Top"/>
    <ListBox VerticalAlignment="Top"/>
</DockPanel>
Marcel Barc
  • 137
  • 1
  • 9