I know. I know. You know everything there is to know about buttons. But, please bear with me. In my last post, I created a form that had two buttons, OK and Cancel. The form was very simple, but there are actually issues with the buttons on the form. The main problem is that the buttons don’t AutoSize. When the form is localized and “Cancel” turns into something that has 20 letters, the button size won’t change automatically. The new text will be truncated.
So how do we get the buttons ready for localization? Let’s take the previous post’s example as a starting point and test it out.
buttonCancel.Text = “xxxxx Cancel xxxxx”;
Let’s fix it.
buttonCancel.Text = “Cancel”;
To summarize, Buttons should be put into a TableLayoutPanel and have the following properties set:
AutoSize = true
AutoSizeMode = GrowAndShrink
MinimumSize = (75, 23)
Padding = (10, 0, 10, 0)
Of course, the above suggestions don’t hold true for every dialog, but probably most.