How can I turn on the vertical scroll bar on a multi-line static textbox object?

5 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 27 Giu 2009
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

Più risposte (0)

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Prodotti


Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by