Appdesigner textbox: is there a way to do multiple lines like for step 1, step 2, etc..?

16 次查看(过去 30 天)
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.

采纳的回答

Ankit
Ankit 2019-11-27
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:
  1 个评论
Aaron Kurlantzick
Aaron Kurlantzick 2019-11-27
Thank you for the quick reply. I actually ended up figuring out the position properties that would fit the text about an hour after posting, and it is similar to the first method you discuss.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by