How to assign different color to items in drop-down list in app designer?

17 vues (au cours des 30 derniers jours)
Is it possible to provide different color to individual item in a drop-down list in app designer?
I have multiple entires in my drop down list. I want to assign either red or green font color to indiviual drop-down item based on my requirement.
How to do this?
  2 commentaires
Reshma Nerella
Reshma Nerella le 12 Avr 2022
Déplacé(e) : Adam Danz le 17 Mar 2023
Currently we do not support changing the color of individual items in drop down list in App Designer. I have brought this issue to the notice of the concerned people and it might be considered for a future release.
Nachiket Wadwankar
Nachiket Wadwankar le 14 Avr 2022
Déplacé(e) : Adam Danz le 17 Mar 2023
Thank you for the clarification.

Connectez-vous pour commenter.

Réponse acceptée

Jasmine Poppick
Jasmine Poppick le 17 Mar 2023
Starting in R2023a you can do this using the addStyle function.
In the StartupFcn callback of the app, you can create a style using uistyle and specify the BackgroundColor property, and then add the style to an item of the drop-down component. For example:
s = uistyle(BackgroundColor="green");
addStyle(app.DropDown,s,"item",2)

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by