Saturday, May 14, 2011

How to Auto Resize Button Depending on Text

If you need a button to automatically resize to fit the text it contains, then simply change the “AutoSize” property to “True”, the “AutoSizeMode” property to “GrowAndShrink”, and the “AutoEllipsis” property to “False”.

If you would like a minimum button size, then set the button Size property to what you would like the minimum button size to be and set the “AutoSizeMode” to “GrowOnly”.

Keep in mind that the UI layout and other elements may need to be adjusted since the button size is now dynamic.

No comments:

Post a Comment