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

14 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Ankit
Ankit el 27 de Nov. de 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:
  1 comentario
Aaron Kurlantzick
Aaron Kurlantzick el 27 de Nov. de 2019
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by