How to set the colour of the outline on a textbutton?

I would like to set the colour of the outline on a textbutton to same as the background or transparent to make the outline disappear.

I have set other outlines with lookAndFeel very easy like this:
juce::Colour(0.0f, 0.0f, 0.0f, 0.0f));

Can I do the textbutton in a similar way?

1 Like

I had the same “issue” and by checking the code for drawing a button background I found it uses ComboBox::outlineColourId colour to draw the outline.
So, you just need to set that colour to change the button outline.

Wow, I checked the source because I couldn’t believe it:

I think that should be at least documented, since TextButton and ComboBox are competely unrelated.
But IMHO it should get it’s own colourId TextButton::outlineColourId, even though that changes behaviour. It’s rather a bug to start with.

Good catch @marcsiquier


2 years later, one still has to use ComboBox::outlineClourId to adjust a Buttons outline colour.


I was stumped on this today, then searching brought me here. I’m definitely suprised that I’m now using the juce::ComboBox::outlineColourId of a button to set its outline colour. I mean it works, but should it?

What’s the right thing to do at this juncture?