# How to disable an item in ComboBox

**URL:** <https://forum.juce.com/t/how-to-disable-an-item-in-combobox/10112>\
**Category:** General JUCE discussion\
**Created:** [March 14, 2013, 12:11pm UTC](https://forum.juce.com/t/how-to-disable-an-item-in-combobox/10112 "2013-03-14T12:11:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://forum.juce.com/u/vinay)\
**Post date:** [March 14, 2013, 12:11pm UTC](https://forum.juce.com/t/how-to-disable-an-item-in-combobox/10112/1 "2013-03-14T12:11:25Z")

</div>

Hi All,  
I am trying to disable an item in a ComboBox using setItemEnabled(itemId, shouldbeEnabled) API. But its not working for me.  
I am using JUCE version 2.0.31. It will be really great if anyone can help me out in this.

Thanks in advance 🙂  
Regards,  
Vinay

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [March 14, 2013, 1:07pm UTC](https://forum.juce.com/t/how-to-disable-an-item-in-combobox/10112/2 "2013-03-14T13:07:33Z")

</div>

What about just not adding the item? Not showing an item that you can’t use from a list seems more straightforward as far as design goes, imho.

---

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://forum.juce.com/u/vinay)\
**Post date:** [March 15, 2013, 5:18am UTC](https://forum.juce.com/t/how-to-disable-an-item-in-combobox/10112/3 "2013-03-15T05:18:09Z")

</div>

The requirement is like I have disable the item in ComboBox on runtime depending on some condition. So I have to add the item.

---

<div class="post-metadata">

**Author:** ![stefanholek](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stefanholek/32/261_2.png) [@stefanholek](https://forum.juce.com/u/stefanholek)\
**Post date:** [March 15, 2013, 8:16am UTC](https://forum.juce.com/t/how-to-disable-an-item-in-combobox/10112/4 "2013-03-15T08:16:38Z")

</div>

[quote=“vinay”]I am trying to disable an item in a ComboBox using setItemEnabled(itemId, shouldbeEnabled) API. But its not working for me.  
I am using JUCE version 2.0.31. It will be really great if anyone can help me out in this.  
[/quote]

setItemEnabled works fine here with JUCE 2.0.38. Try harder. 😉
