Appdesigner textbox: is there a way to do multiple lines like for step 1, step 2, etc..?
9 views (last 30 days)
Show older comments
Aaron Kurlantzick
on 26 Nov 2019
Commented: Aaron Kurlantzick
on 27 Nov 2019
I'm trying to get a help textbox working for my app, but I'm having difficulty with the string. Currently I have this:
d = dialog('position', [200 500 300 300], 'Name', 'Help');
txt = uicontrol('Parent',d,'Style','text','HorizontalAlignment','left','Position', [20 200 280 40], 'String', 'Co is the concentration of alcohol taken into the system (g/L), k is the rate constant of gastric emptying (L/hour), ka is the rate of absorbance by the blood (L/hour), a is the constant for feedback control (g^2/hour^2), Vm is the maximum velocity (g/L/hour), Km is the Michaelis—Menten reaction constant (g/L)');
This makes a string that wraps to the second line, but stops at 'a is the constant...'
Is there a way to go make separate lines or just someway to have the whole string display?
Any help would be appreciated.
0 Comments
Accepted Answer
Ankit
on 27 Nov 2019
Hi Aaron,
by changing the position property (position: [left bottom width height]) you can fit your complete text.
d = dialog('position', [200 500 300 300], 'Name', 'Help');
txt = uicontrol('Parent',d,'Style','text','HorizontalAlignment','left','Position', [20 100 280 100],...
'String', 'Co is the concentration of alcohol taken into the system (g/L), k is the rate constant of gastric emptying (L/hour), ka is the rate of absorbance by the blood (L/hour), a is the constant for feedback control (g^2/hour^2), Vm is the maximum velocity (g/L/hour), Km is the Michaelis—Menten reaction constant (g/L)');
or using 'Units': 'normalized'
d = dialog('position', [200 500 300 300], 'Name', 'Help');
txt = uicontrol('Parent',d,'Units','normalized','Style','text','HorizontalAlignment','left','Position', [0 0 1 1],...
'String', 'Co is the concentration of alcohol taken into the system (g/L), k is the rate constant of gastric emptying (L/hour), ka is the rate of absorbance by the blood (L/hour), a is the constant for feedback control (g^2/hour^2), Vm is the maximum velocity (g/L/hour), Km is the Michaelis—Menten reaction constant (g/L)');
But I would prefer the solution provided in the below link:
More Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer 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!