# Change DROP/COMBO Background Color When Disabled

**URL:** <https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474>\
**Category:** questions\
**Tags:** color\
**Created:** [August 8, 2023, 1:59pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474 "2023-08-08T13:59:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![totalhip](https://clarionhub.com/user_avatar/clarionhub.com/totalhip/32/1477_2.png) [@totalhip](https://clarionhub.com/u/totalhip)\
**Post date:** [August 8, 2023, 1:59pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/1 "2023-08-08T13:59:36Z")

</div>

I sometimes prefer to change the background color of controls when disabled. Something like:

```auto
?TEXT{PROP:Disable} = CHOOSE(MyVar=False)
?TEXT{PROP:Background} = CHOOSE(?TEXT{PROP:Disable}=True,COLOR:BtnFace,COLOR:None)

```

If this same code is used for a DROP or COMBO control, the background color does not change.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [August 8, 2023, 2:31pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/2 "2023-08-08T14:31:50Z")

</div>

I think DISABLE forces the colors.

IIRC the way I did something like that was to not Disable instead set `PROP:ReadOnly=True`, plus set `PROP:Skip=True`. Then I set my colors to my preferred Disabled look which was more readable. This also allowed to Copy the value which Disable does not allow copy.

---

<div class="post-metadata">

**Author:** ![totalhip](https://clarionhub.com/user_avatar/clarionhub.com/totalhip/32/1477_2.png) [@totalhip](https://clarionhub.com/u/totalhip)\
**Post date:** [August 8, 2023, 2:42pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/3 "2023-08-08T14:42:07Z")

</div>

> [@CarlBarnes](#):
>
> I think DISABLE forces the colors.

But only for list, drop, combo controls?

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [August 8, 2023, 2:56pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/4 "2023-08-08T14:56:16Z")

</div>

Every control has its own handling. A Combo is special being an ENTRY with a LIST and BUTTON. Same for a DROP LIST just the ENTRY is ReadOnly.

---

<div class="post-metadata">

**Author:** ![totalhip](https://clarionhub.com/user_avatar/clarionhub.com/totalhip/32/1477_2.png) [@totalhip](https://clarionhub.com/u/totalhip)\
**Post date:** [August 8, 2023, 3:26pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/5 "2023-08-08T15:26:03Z")

</div>

Wondering if it possible (easily) to reference the entry part of a combo or drop? The background of disabled entry controls can be changed.

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [August 8, 2023, 4:10pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/6 "2023-08-08T16:10:35Z")

</div>

I wonder if it’s possible to use code [from this example](https://clarionhub.com/t/how-to-alter-the-icon-of-a-combo-drop-control/698) @MarkGoldberg wrote to change the icon to do what you need with the internal controls.

Mark

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [August 8, 2023, 4:38pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/7 "2023-08-08T16:38:13Z")

</div>

Douglas,  
What isn’t working for you?  
This code works fine for me. Maybe, I’m not understanding what you are after.

```auto

  PROGRAM

OMIT('***')
 * Created with Clarion 11.0
 * User: Rick
 * Date: 8/8/2023
 * Time: 9:32 AM
 ***

  MAP
TestWindowProc procedure()
  END

  CODE
  TestWindowProc()
  
TestWindowProc procedure()
COMBO1:Queue QUEUE
Field1 STRING(20)
                                END
LIST1:Queue QUEUE
Field1 STRING(20)
                                END

TestWindow WINDOW('Test Window'),AT(245,20,235,118),GRAY,SYSTEM,DOUBLE
                                  PROMPT('Combo'),AT(16,32),USE(?PROMPT1)
                                  COMBO(@s20),AT(80,27,104,14),USE(?COMBO1),DROP(15),FROM(COMBO1:Queue)
                                  PROMPT('Drop List'),AT(16,50),USE(?PROMPT1:2)
                                  LIST,AT(80,45,104,14),USE(?LIST1),DROP(15),FROM(LIST1:Queue)
                                  BUTTON('Toggle Disable'),AT(26,86),USE(?btnToggle)
                                END

  code
  open(TestWindow)
  ACCEPT
    case EVENT()
    of EVENT:Accepted
      case FIELD()
      of ?btnToggle
        if ?COMBO1{PROP:Disable} = ''
          ?COMBO1{PROP:Background} = COLOR:Red
          ?COMBO1{PROP:Disable} = true
        ELSE
          ?COMBO1{PROP:Background} = COLOR:NONE
          ?COMBO1{PROP:Disable} = ''
        END
        if ?LIST1{PROP:Disable} = ''
          ?LIST1{PROP:Background} = COLOR:Teal
          ?LIST1{PROP:Disable} = true
        ELSE
          ?LIST1{PROP:Background} = COLOR:NONE
          ?LIST1{PROP:Disable} = ''
        END
        DISPLAY()
      END
    END
  END
  close(TestWindow)
  

```

---

<div class="post-metadata">

**Author:** ![totalhip](https://clarionhub.com/user_avatar/clarionhub.com/totalhip/32/1477_2.png) [@totalhip](https://clarionhub.com/u/totalhip)\
**Post date:** [August 8, 2023, 5:19pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/8 "2023-08-08T17:19:14Z")

</div>

Rick,  
Thanks. This is a more basic and better test than what I was using. Long forgotten in my list control class is some code setting PROPLIST:BarFrame colors. My guess is that this class code could be overriding procedure code colors since both a disabled drop or combo would be displaying the value of the selected record. Using your code, looks like I will have to test by also setting the BarFrame properties.

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [August 8, 2023, 5:34pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/9 "2023-08-08T17:34:02Z")

</div>

I did a quick test and ENTRY and COMBO colored fine. The LIST,DROP would Not Color.

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/6/65adaae067ce9b02268acb993a0d00ced985b648.png)

A possible workaround would be to sort of clone the LIST size/position as a ENTRY or COMBO then color that while hiding the LIST. You can’t use CLONE()

I tried coloring the PROP:ListFEQ but it didn’t work, which makes sense it colors the drop list.

I tried every Color Property my Window Preview Tool allows and none stuck. I also added a FORMAT with default color but nope.

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/e/e9a6efc59b79a0ecc7bfa769d4f3bee9c00fa5ff.png)

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/6/63798f3fe403890991aeae43a980cee888c4f499.png)

---

<div class="post-metadata">

**Author:** ![totalhip](https://clarionhub.com/user_avatar/clarionhub.com/totalhip/32/1477_2.png) [@totalhip](https://clarionhub.com/u/totalhip)\
**Post date:** [August 9, 2023, 1:59pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/10 "2023-08-09T13:59:26Z")

</div>

> [@CarlBarnes](#):
>
> I did a quick test and ENTRY and COMBO colored fine. The LIST,DROP would Not Color.

After a bit more testing, it seems to me the background of the read only display of a LIST,DROP simply does not change using PROP:Background. It is either set on open(window) or another unknown property is involved. Does that agree with what you are seeing?

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [August 10, 2023, 7:09pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/12 "2023-08-10T19:09:31Z")

</div>

Did any of you guys try a style in the listbox? Just curious enough to ask someone else. 🙂

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [August 10, 2023, 9:54pm UTC](https://clarionhub.com/t/change-drop-combo-background-color-when-disabled/6474/13 "2023-08-10T21:54:44Z")

</div>

I tried FORMAT() colors and they had no effect. When not dropped there is an ENTRY showing the value so makes sense Format does nothing.

IIRC in Windows proper the COMBO,DROP and LIST,DROP List are the same control, but the LIST is a Read Only Entry.
