Adding Text when Button is Pushed on App Designer

조회 수: 23 (최근 30일)
Celia Murillo Amezcua
Celia Murillo Amezcua 2020년 11월 28일
편집: Mario Malic 2020년 11월 28일
Hello!
I was wondering if there was a way I could make text appear when a button is pushed in an app? For example, if there was a button labeled "Rules" it would show a text with the rules once it was pressed.
Thanks!
  댓글 수: 1
Mario Malic
Mario Malic 2020년 11월 28일
편집: Mario Malic 2020년 11월 28일
Hi,
Yes, it's possible, here's an example code.
Use the state button to toggle the visibility of the Label. Add the ValueChangedFcn callback to the button.
function ButtonValueChanged(src, event)
if Button.Value
Label.Visible = on;
else
Label.Visible = off;
end
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by