Reputation: 1393
I have here 2 buttons, dock at the bottom... But I want them side by side, not over and under. How can I do that?
I dock them because WindowState = Maximize
. If I manually position them, they won't fill the space from left to right. I tried to use anchor, but it doesn't achieve what I want.
I want them like this even in full screen. thanks
Upvotes: 2
Views: 912
Reputation: 101052
Wrap your Buttons into a TableLayoutPanel
:
Create a TableLayoutPanel
with two columns and one row. Set the size of each column to 50%
. Set the Dock
property to DockStyle.Bottom
.
Add a Button
to each column. Set the Dock
property of each Button
to DockStyle.Fill
.
Add this TableLayoutPanel
to your Form
/Container
instead of the two Buttons directly:
Upvotes: 3
Reputation: 3038
I'm not sure if it's the best way but it seems to do the job.
Hope it helps.
Upvotes: 0