How can I display multiline text in a push button by setting its 'String' property ?
Show older comments
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?
Accepted Answer
More Answers (1)
Rob Campbell
on 20 Nov 2019
8 votes
You can have multi-line text in a button as follows:
h_button.String='<html>line one<br />line 2 &pi</html>';
This is tested in R2019b. I don't know when this option became available.
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!