# ComboBox focused outline colour

**URL:** <https://forum.juce.com/t/combobox-focused-outline-colour/24516>\
**Category:** General JUCE discussion\
**Created:** [October 5, 2017, 3:08pm UTC](https://forum.juce.com/t/combobox-focused-outline-colour/24516 "2017-10-05T15:08:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![burns](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/burns/32/1473_2.png) [@burns](https://forum.juce.com/u/burns)\
**Post date:** [October 5, 2017, 3:08pm UTC](https://forum.juce.com/t/combobox-focused-outline-colour/24516/1 "2017-10-05T15:08:21Z")

</div>

Hi everyone,

I have a small issue, but I think it’s still worth mentioning.

The ComboBox class seems to be missing a colour ID for its outline when in focused state.  
Other components do offer it, like for example TextEditor::focusedOutlineColourId, but in ComboBox I can only specify the outline colour while not in focus via ComboBox::outlineColourId.

So in the screenshot below, I have set the regular outline to black, but I have no way to change the gray outline shown when I open the ComboBox.

![ComboBoxFocus](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/b/b100405bcdf205b526b2ce317f8319537804057b.png)

I know I can just subclass it and override the paint method, but this just seems like something that was overseen or forgotten 🙂

Cheers.

---

<div class="post-metadata">

**Author:** ![djogon1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/djogon1/32/3067_2.png) [@djogon1](https://forum.juce.com/u/djogon1)\
**Post date:** [November 14, 2017, 3:16pm UTC](https://forum.juce.com/t/combobox-focused-outline-colour/24516/2 "2017-11-14T15:16:04Z")

</div>

I was just looking for the same thing and stumbled on this post.

In the end - I have a look and feel class already so I wanted to override the ComboBox pain method, but when I looked at it - it turned out that “ **ComboBox::ColourIds::buttonColourId** ” is used to draw that outline when focused.

So I just changed that colour though, but this is unclear and confusing. The documentation states “_Base colour for the button_”. Not clear what button is referred to here. I assume it is a button that represents one list item or just the one that triggers the drop down, but it would be much better if we could call this focusedOutlineColourId.

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [November 20, 2017, 4:48pm UTC](https://forum.juce.com/t/combobox-focused-outline-colour/24516/3 "2017-11-20T16:48:28Z")

</div>

Yep, I’ll add a `focusedOutlineColourId`.

---

<div class="post-metadata">

**Author:** ![Turrubiates](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/turrubiates/32/9490_2.png) [@Turrubiates](https://forum.juce.com/u/Turrubiates)\
**Post date:** [May 6, 2020, 9:26pm UTC](https://forum.juce.com/t/combobox-focused-outline-colour/24516/4 "2020-05-06T21:26:32Z")

</div>

Hi, I’m kind new in JUCE. Can you please let me know how did you set the background colour for the item in combobox. I have been looking but I am pretty stuck. Thanks in advance

---

<div class="post-metadata">

**Author:** ![CarlColijn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/carlcolijn/32/12050_2.png) [@CarlColijn](https://forum.juce.com/u/CarlColijn)\
**Post date:** [May 9, 2020, 3:44pm UTC](https://forum.juce.com/t/combobox-focused-outline-colour/24516/5 "2020-05-09T15:44:26Z")

</div>

Depends on which part you want to modify. The box’s background color itself uses ComboBox::backgroundColourId; look at the code for `LookAndFeel_V4::drawComboBox` to see what’s going on. The dropdown list uses PopupMenu::backgroundColourId (comboboxes just use a popup menu to display the list).

---

<div class="post-metadata">

**Author:** ![CarlColijn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/carlcolijn/32/12050_2.png) [@CarlColijn](https://forum.juce.com/u/CarlColijn)\
**Post date:** [May 9, 2020, 3:51pm UTC](https://forum.juce.com/t/combobox-focused-outline-colour/24516/6 "2020-05-09T15:51:25Z")

</div>

Hi ed95,

Thanks for adding that in more than 2 years ago! However, at least Juce 5.3.2’s `LookAndFeel_V4::drawComboBox` doesn’t pick it up… It has hard-coded `ComboBox::outlineColourId` in there for the border. I don’t know if this is already fixed in a later version, but see it as a heads up.
