Display information when ticking the checkbox in app designer.
15 次查看(过去 30 天)
显示 更早的评论
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1336014/image.jpeg)
2 个评论
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.
采纳的回答
Adam Danz
2023-3-26
移动:Adam Danz
2023-3-27
- 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
- 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
- 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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!