MATLAB: How to turn on the vertical scroll bar on a multi-line static textbox object

MATLABmultilinescrollscrollbarsliderbarstatictextbox;vertical

When I want to display static text that exceeds the size of the textbox, MATLAB will cut the text without providing a scroll bar as in the case with the edit text box. I need a way to force the static textbox to have a default vertical scroll bar so the user of my GUI will be able to scroll through the text box to read my text.

Best Answer

The ability to have a vertical scroll bar on a multi-line textbox is not available in MATLAB 7.0.1 (R14SP1).
To work around this issue, you can use a editbox where the "Min" and "Max" properties are such that "Max - Min > 1".
h = uicontrol('Style','edit','Position',[10 10 150 50],...
'min',0,'max',2,'enable','inactive'); % create a listbox object
str = {['Since its founding in 1984, MathWorks has become the leading ',...
'global provider of technical computing and model-based design ',...
'software. Headquartered in Natick, Massachusetts, MathWorks ',...
'currently employs more than 1,000 people worldwide. ']};
set(h,'String',str) % display the string