MATLAB Answers

Matt J

Multi-colored pop-up menu entries

Asked by Matt J
on 11 Jun 2013
Accepted Answer by Hugo

Is there a way to make a gui pop-up menu display its list of selections with different text colors? What about different fonts and typesetting (Italics, Boldface, etc...)



No products are associated with this question.

1 Answer

Answer by Hugo
on 11 Jun 2013
 Accepted answer

Yes, try this:

uicontrol('style','popup','string',{'<HTML><FONT COLOR="red" SIZE="10" FACE="ARIAL"><b><i>Here</i></b></HTML>','<HTML><FONT COLOR="blue" SIZE="4" FACE="Courier"><b>There</b></HTML>','<HTML><FONT COLOR="maroon" SIZE="6" FACE="GEORGIA">Anywhere</HTML>'})

Basically, I'm just using HTML. Take a look at each element in the cell of strings. Here is the first one.

'<HTML><FONT COLOR="red" SIZE="10" FACE="ARIAL"><b><i>Here</i></b></HTML>'

There are many ways you can format text in HTML. You can find that in google, but if you have no idea at all, you can start by taking a look at and then try to find other more complete tutorials if you need so.

Hope this helps. Best regards

  1 Comment

Matt J
on 11 Jun 2013


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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!