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 Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by