Filter löschen
Filter löschen

How can I make the numeric edit field blank?

24 Ansichten (letzte 30 Tage)
석호 김
석호 김 am 22 Mai 2023
Bearbeitet: Amos am 26 Mai 2023
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?

Akzeptierte Antwort

Matt J
Matt J am 22 Mai 2023
You can set the ValueDisplayFormat property to %0.0d

Weitere Antworten (1)

Amos
Amos am 26 Mai 2023
Bearbeitet: Amos am 26 Mai 2023
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

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by