How to disable Edit Field (Text) in App Designer?
58 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2020-9-16
编辑: MathWorks Support Team
2020-9-16
I would like to know how to set "Edit Field (Text)" disable to edit in App Designer. I want to change the editable status able/disable via Switch On/Off.
采纳的回答
MathWorks Support Team
2020-9-16
编辑:MathWorks Support Team
2020-9-16
Here is an example to show how to control Editable about "Edit Field (Text)".
function SwitchValueChanged(app, event)
value = app.Switch.Value;
if ( strcmpi(value,'On') )
app.VelocityEditField.Enable = 'On'
app.TemperatureEditField.Editable = 'On'
% app.LoadEditField.Editable = 'On'
else
app.VelocityEditField.Enable = 'Off'
*app.TemperatureEditField.Editable = 'Off'*
% app.LoadEditField.Editable = 'Off'
end
end
This is the captured image to show the result of the above example. It is set so that editing is not possible at Temperature where Editable is off.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!