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

19 ビュー (過去 30 日間)
Nachiket Wadwankar
Nachiket Wadwankar 2022 年 3 月 11 日
移動済み: Adam Danz 2023 年 3 月 17 日
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 件のコメント
Reshma Nerella
Reshma Nerella 2022 年 4 月 12 日
移動済み: Adam Danz 2023 年 3 月 17 日
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 2022 年 4 月 14 日
移動済み: Adam Danz 2023 年 3 月 17 日
Thank you for the clarification.

サインインしてコメントする。

採用された回答

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 drop-down component. For example:
s = uistyle(BackgroundColor="green");
addStyle(app.DropDown,s,"item",2)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by