# Show/hide Textbox in custom sliders

**URL:** <https://forum.juce.com/t/show-hide-textbox-in-custom-sliders/14031>\
**Category:** General JUCE discussion\
**Created:** [December 13, 2014, 1:33am UTC](https://forum.juce.com/t/show-hide-textbox-in-custom-sliders/14031 "2014-12-13T01:33:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lapsang](https://avatars.discourse-cdn.com/v4/letter/l/3be4f8/32.png) [@lapsang](https://forum.juce.com/u/lapsang)\
**Post date:** [December 13, 2014, 1:33am UTC](https://forum.juce.com/t/show-hide-textbox-in-custom-sliders/14031/1 "2014-12-13T01:33:53Z")

</div>

I'm having troubles trying to show/hide the textbox in my custom sliders.

Using&nbsp;_hideTextBox_ if the box is already there doesn't work. I would like to have it dynamically show if I'm draggin my slider. What should I do?

Thanks.

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [December 13, 2014, 8:32am UTC](https://forum.juce.com/t/show-hide-textbox-in-custom-sliders/14031/2 "2014-12-13T08:32:43Z")

</div>

I usually just call setTextBoxStyle() to show or hide the textbox. Are you sure you want to show it dynamically? Won't that cause the slider to resize every time a user drags it? Anyhow, if you want custom behavior like that you can do it in the look and feel method, or you can override the sliders mouse events in your own subclass of Slider.

---

<div class="post-metadata">

**Author:** ![lapsang](https://avatars.discourse-cdn.com/v4/letter/l/3be4f8/32.png) [@lapsang](https://forum.juce.com/u/lapsang)\
**Post date:** [December 14, 2014, 12:57am UTC](https://forum.juce.com/t/show-hide-textbox-in-custom-sliders/14031/3 "2014-12-14T00:57:11Z")

</div>

Ok thanks, I think I'll go for another way. I'll use a Label and I will try to dynamically move it under each slider.&nbsp;

---

<div class="post-metadata">

**Author:** ![andrewj](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/andrewj/32/13428_2.png) [@andrewj](https://forum.juce.com/u/andrewj)\
**Post date:** [December 14, 2014, 9:49am UTC](https://forum.juce.com/t/show-hide-textbox-in-custom-sliders/14031/4 "2014-12-14T09:49:09Z")

</div>

Did you consider using the slider’s popup display capability instead?

setPopupDisplayEnabled (bool isEnabled, Component \* parentComponentToUse)
