Why is the label not coming up?

3 次查看(过去 30 天)
Muazma Ali
Muazma Ali 2023-6-7
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

回答(1 个)

Kevin Holly
Kevin Holly 2023-6-7
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

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by