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

조회 수: 14 (최근 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