Change Color of each individual item in a Listbox (using APP designer)

I want to know how to change the color of each individual item in a Listbox. I know there are some solutions using uicontrol, but I want to know how to do it in APP designer.

 Respuesta aceptada

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 list box. For example:
s = uistyle(BackgroundColor="yellow");
addStyle(app.ListBox,s,"item",2)

Más respuestas (2)

Cameron B
Cameron B el 27 de En. de 2022
It doesn't look like you can change the value for individual BackgroundColor or FontColor on app designer (as opposed to a regular figure). See this for more details.

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Preguntada:

el 26 de En. de 2022

Respondida:

el 17 de Mzo. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by