Why is the label not coming up?

5 Ansichten (letzte 30 Tage)
Muazma Ali
Muazma Ali am 7 Jun. 2023
Beantwortet: Kevin Holly am 7 Jun. 2023
Hi
in app3 , the label is supposed to show 'choose two or three salts¨ when the user has not chosen any salts. But the label is not showing up when the user hasnt chosen anything. I put a condition of isempty for listbox value but it seems it is not working. And the while loop there is not working either. The code is supposed to show the picture of listbox with the the instruction in the label of choosing two to three salts , as many time as the nr of the variable called antall_soner from app2.
I am attaching app2 also which is the main app

Antworten (1)

Kevin Holly
Kevin Holly am 7 Jun. 2023
I made the default text for Label2, "Choose the salts available!". This way it appears when the app first starts. If you do not want it present during initialization, you can delete this.
If the user deselects everything in the listbox using "Ctrl+click", app.numSelected would be zero, but not empty. Therefore, I added this to your if condition:
|| app.numSelected==0

Kategorien

Mehr zu Interactive Control and Callbacks 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