Display information when ticking the checkbox in app designer.

8 ビュー (過去 30 日間)
Yen
Yen 2023 年 3 月 25 日
移動済み: Adam Danz 2023 年 3 月 27 日
hi, I'm having a little problem: how to click on the check box, the parameters like Size , Color.. will appear on the screen.
Please help me and thanks a lot
  2 件のコメント
Adam Danz
Adam Danz 2023 年 3 月 25 日
You must assign a ValueChangedFcn to the checkbox to react when users check or uncheck the box.
Within the ValueChangedFcn, you can turn off/on the Visible property of the Size and Color objects based on the Value returned within the callback function.
Yen
Yen 2023 年 3 月 26 日
I wrote like that and not sure if it's correct. Can you help me go to the next part?

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2023 年 3 月 26 日
移動済み: Adam Danz 2023 年 3 月 27 日
  1. See this answer (Step 3) to learn how to add a ValueChangedFunction. This will add a callback function in your app's code. https://www.mathworks.com/matlabcentral/answers/503673-app-designer-create-a-discrete-slider#answer_414023
  2. The Callback function will have 2 inputs. You can get the value of the checkbox from the first input using something like value=app.Checkbox.Value
  3. If the Value is true, then you should turn on the visible properties of the objects you want to control. app.OBJECT.Visible=true, where OBJECT is the handle to whatever object you're targetting. If the Value is false, set visible to false.
  1 件のコメント
Yen
Yen 2023 年 3 月 27 日
移動済み: Adam Danz 2023 年 3 月 27 日
ohh i solved the problem, thanks a lot <3

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by