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

조회 수: 40 (최근 30일)
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.

채택된 답변

Jasmine Poppick
Jasmine Poppick 2023년 3월 17일
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)

추가 답변 (2개)

Cameron B
Cameron B 2022년 1월 27일
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.

Image Analyst
Image Analyst 2022년 1월 27일
편집: Image Analyst 2022년 1월 27일
Not sure you can, but if anyone knows how to do it, it's Undocumented Matlab

카테고리

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