MATLAB Answers

How to modify the text visibility in a Gui that created using App Designer

3 ビュー (過去 30 日間)
balandong
balandong 2020 年 1 月 21 日
コメント済み: Ajay Kumar 2020 年 1 月 22 日
Dear Coder,
I have develop a gui using AppDeveloper.
In a separate main.m file, I would like to display the GUI and change the visibility of a Label. Say the component having name of app.Label.
If using GUIDE, I know the command to achieve this will be
set(handles.LabelTag,'Visible','off');
But having migrated to App Developer, the command is not working.
Some method in the net show that the code should be something like below, however, its is not working for my case.
app.Label.Visible = 'off'
Appreciate if someone can show which part i do wrong

  0 件のコメント

サインイン to comment.

採用された回答

Ajay Kumar
Ajay Kumar 2020 年 1 月 21 日
編集済み: Ajay Kumar 2020 年 1 月 21 日
What is the exact name of the component? I would suggest you to rename it if its only Label.
For example, if you rename it to Component1EditField, then to change the visibility, you can use:
app.Component1EditFieldLabel.Visible = 'off';

  6 件のコメント

表示 3 件の古いコメント
Ajay Kumar
Ajay Kumar 2020 年 1 月 22 日
Ok, this is a different context now.
Replace the whole main.m file with
x = GuiApp;
x.Component1EditFieldLabel.Visible = 'off';
balandong
balandong 2020 年 1 月 22 日
Hi Ajay,
Thanks for the suggestion, it work like charm.
Ajay Kumar
Ajay Kumar 2020 年 1 月 22 日
You're welcome.

サインイン to comment.

その他の回答 (0 件)

サインイン してこの質問に回答します。

タグ


Translated by