Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to set the Background color of a PopupMenu to blue. I already searched in the documentation center, but I didn't find any option that seemed suitable.

    {"Country1", "Country2", "Country3"}, 
    ImageSize -> {180, 60}, Background -> Blue,
    Alignment -> {Center, Center},
    MenuStyle ->Directive[Orange, 20, Bold]

enter image description here

share|improve this question

To get the look subbu asked for on OS X, I had to override the default appearance of the pop-up menu widget. Here is what I came up with:

PopupMenu[Dynamic@x, {"Country1", "Country2", "Country3"}, "", 
   Row[{Panel[Style[Dynamic@x, Orange, 20, Bold, Background -> Blue], 
           ImageSize -> {160, 60}, Appearance -> None, Background -> Blue, 
           Alignment -> {Center, Center}], 
        Panel[Style["\[FilledDownTriangle]", 16, Bold, 
           Background -> White], ImageSize -> {20, 60}, Appearance -> None, 
           Alignment -> {Center, Center}]}, Frame -> True, 
      FrameMargins -> None], MenuStyle -> Directive[Orange, 20, Bold]]

It produces a control that looks like this:

custom pop-up menu

share|improve this answer
@m_goldberg.Really I like your code.but How can i set background color for Menu ? – subbu Nov 23 '12 at 7:36

I am assuming that you made the blue background in a graphics program to show us what you want because on my computer your blue background is obscured by the default appearance.

enter image description here

Setting Appearance->None will fix this ...although on my mac I lose the "guiding up-down arrows" when I do that.

enter image description here

share|improve this answer
I'm not sure, but could the OP have meant to ask how to color the pop-up part of the menu blue and not the fixed part? The latter he already colored blue. – Sjoerd C. de Vries Nov 22 '12 at 21:30
@SjoerdC.deVries I assumed he made that in a graphics program because his code does not deliver that screen grab on my computer ...will add a grab. – Mike Honeychurch Nov 22 '12 at 21:40
It looked like that on my Win7 PC. So, no manual coloring there... – Sjoerd C. de Vries Nov 22 '12 at 21:54
@SjoerdC.deVries interesting. Maybe that is what he meant. I'll wait for him to reply/clarify. Might be worth leaving this answer here for Mac users. – Mike Honeychurch Nov 22 '12 at 23:04
Why no copyable code? – Mr.Wizard Nov 23 '12 at 0:55

One can get close by using the

{value1 -> label1, value2 -> label2, …}

format for PopupMenu and making the labels with a blue background.

countryList = {"Country1", "Country2", "Country3"}

labelList = Map[
     Spacer[{60, 56, 23}],
     Style[#, Orange, 20, Bold, Background -> Blue],
    Background -> Blue] &,

Mathematica graphics

Now generate a set of rules to be used as the input to PopupMenu

popupRules = Map[countryList[[#]] -> labelList[[#]] &, Range[3]]

Mathematica graphics

Now use the rules as input to PopupMenu

 "Country 1",
 ImageSize -> {180, 60},
 Background -> Blue,
 Alignment -> {Center, Center}

I don't know how to use SE Uploader to show an active PopupMenu so you will have to execute the code in order to see it.

If you know how to show an active `PopupMenu I would appreciate a tip on how it is done. I am on a PC.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.