How would you approach making a "table" filled with buttons?
Ex. (b=button control)
b b b b b
b b b b b
b b b b b
b b b b b
I understand how to generally use Dock and Stack Panels. Would I have to make a nested group of stack panels where I make 5 vertical stack panels and then place them in a horizontal stack panel? or is there an easier way?
<UniformGrid Rows="5" Columns="5">
<!-- your buttons -->
</UniformGrid>
You can learn about the UniformGrid at MSDN.
Constraining the Rows is optional, if you may have more than exactly 25 buttons.
If you do not necessarily want all the cells of the grid to have equal size, then you can lay out a standard Grid. The drawback to that is that declaring the ColumnDefinitions and RowDefinitions properties is verbose.
If you dont mind the buttons being evenly spaced you could use
<UniformGrid Columns="5">
<Button />
...
<Button />
</UniformGrid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With