# Text Button that acts like an on/off button

**URL:** <https://forum.juce.com/t/text-button-that-acts-like-an-on-off-button/25262>\
**Category:** General JUCE discussion\
**Created:** [November 22, 2017, 7:34pm UTC](https://forum.juce.com/t/text-button-that-acts-like-an-on-off-button/25262 "2017-11-22T19:34:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)\
**Post date:** [November 22, 2017, 7:34pm UTC](https://forum.juce.com/t/text-button-that-acts-like-an-on-off-button/25262/1 "2017-11-22T19:34:56Z")

</div>

Sorry for the newbie question (I expect I’ve got loads more 🙂 )  
But what’s the best way of making a toggle button out of a normal TextButton? I don’t want a piddly little tick box thing I want proper lozenge shaped colour goodness!

What’s the best way?

Thanks!!  
Dave.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [November 22, 2017, 7:40pm UTC](https://forum.juce.com/t/text-button-that-acts-like-an-on-off-button/25262/2 "2017-11-22T19:40:29Z")

</div>

Simply call [Button::setClickingTogglesState (true)](https://juce.com/doc/classButton#a675d6848c16e265ff334b2d51328d8d2) on it.  
It’s a common feature of all buttons, so works for TextButton as well…  
HTH

---

<div class="post-metadata">

**Author:** ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)\
**Post date:** [November 22, 2017, 7:44pm UTC](https://forum.juce.com/t/text-button-that-acts-like-an-on-off-button/25262/3 "2017-11-22T19:44:44Z")

</div>

OOo, thanks, I thought I got a ‘redacted’ warning from that one. My mistake. 😄  
Thanks again!!!
