Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Possible to change the Foreground Color of individual lines of a listbox??

Asked by Jay on 8 May 2012

Hello,

I have a listbox with a few strings that I'd like to change the color of in order to indicate status. Is it possible to assign different foreground colors to different strings?

Thanks in advance!

Also note, I'm in 2007b if it makes a difference.

0 Comments

Jay

Products

No products are associated with this question.

1 Answer

Answer by Jay on 8 May 2012

Found my answer here:

http://undocumentedmatlab.com/blog/html-support-in-matlab-uicomponents/

Which recommended:

uicontrol('Style','list', 'Position',[10,10,70,70], 'String', ...
{'<HTML><FONT color="red">Hello</Font></html>', 'world', ...
'<html><font style="font-family:impact;color:green"><i>What a', ...
'<Html><FONT color="blue" face="Comic Sans MS">nice day!</font>'});

0 Comments

Jay

Contact us