How can I make the numeric edit field blank?

21 ビュー (過去 30 日間)
석호 김
석호 김 2023 年 5 月 22 日
編集済み: Amos 2023 年 5 月 26 日
Hi. I have a question about numeric edit field object when using App Designer.
I want to make the numeric edit field blank, but it shows that 'AllowEmpty' property is off.
However, I can't find the 'AllowEmpty' property at App Designer.
Isn't it possible to make numeric edit field blank?

採用された回答

Matt J
Matt J 2023 年 5 月 22 日
You can set the ValueDisplayFormat property to %0.0d

その他の回答 (1 件)

Amos
Amos 2023 年 5 月 26 日
編集済み: Amos 2023 年 5 月 26 日
It appears the .AllowEmpty property is available but hidden (not listed; no autocomplete)
The following works (R2023a):
classdef xEmptyNumField < matlab.ui.componentcontainer.ComponentContainer
% Properties that correspond to underlying components
properties (Access = private, Transient, NonCopyable)
allowEmptyButton matlab.ui.control.StateButton
xview matlab.ui.control.NumericEditField
end
...
% Callbacks that handle component events
methods (Access = private)
% Value changed function: allowEmptyButton
function allowEmptyButtonValueChanged(comp, event)
comp.xview.AllowEmpty = comp.allowEmptyButton.Value;
end
end
...
end

カテゴリ

Help Center および File ExchangeCreate Custom UI Components についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by