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 CenterFile Exchange에서 Create Custom UI Components에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by