How to disable Edit Field (Text) in App Designer?

53 ビュー (過去 30 日間)
MathWorks Support Team
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
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 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by