Center aligning the buttons in a Windows Form
I was trying to align some buttons in the center of a windows form. I was tried to find any properties in a button can set it to be center aligned. But there is no such property! I tried to use layout controls. The table layout control can be very similar stuff. That is still not what I want. Of course, I can do it in the windows resizing, changing the button positions by codes. But that is too complex! Finally, I found a simple way. I just drop a panel at the center position and set no achor. I think that makes it flow at the center.
And then, you can drop buttons in the panel and set their achor property to "Top, Bottom, Left, Right"
Then it will move to the center position when the windows is resized.
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 820 feedbacks awaiting moderation...
Form is loading...