MATLAB: How to display multiline text in a push button by setting its ‘String’ property

MATLABmulti-linepushbutton

Typing a very long string in the push button uicontrol object's 'String' property causes the displayed text to be truncated if the pushbutton object is not long enough to accommodate the entire string.
How can I wrap the text to prevent it from getting truncated ? Is it possible to display multiline strings in the push button?

Best Answer

As of MATLAB 7.1 (R14SP3), push buttons do not support multiline text. This is in line with Windows UI design standards.
The workaround to the problem is to modify the size of the push button in the GUI design to accommodate the longest string that it will hold at any time.
Alternatively, you can use a static-text object to display the information, since static-text objects can be multiline.