Question Change forecolor of Combo-box

patelspam

Member
Hello!
I was trying to change the forecolor of the object "combo-box" but i wasn't able to. I did found that if i change the name of the file "prowin.exe.manifest" (located in the bin folder) the objects change the color as intended but the object version used in my company program becomes far too old that ends up changing the visual in a bad way. Is there a workaround to this problem? Maybe changing the manifest file or even working around by code?

Thank you!
JP
 
There is the FGCOLOR code setting but that only affects the list and not the actual value/screen value:

Code:
DEFINE VARIABLE COMBO-BOX-1 AS CHARACTER FORMAT "X(256)":U 
     LABEL "Combo 1" 
     VIEW-AS COMBO-BOX INNER-LINES 5
     LIST-ITEMS "Item 1","Item 2","Item 3","Item 4","Item 5" 
     DROP-DOWN-LIST
     SIZE 16 BY 1
     FGCOLOR 9 NO-UNDO.

1726567368074.png

The only option I can think of is try removing the theme as outlined here and see if FGCOLOR works then:

 
There is the FGCOLOR code setting but that only affects the list and not the actual value/screen value:

Code:
DEFINE VARIABLE COMBO-BOX-1 AS CHARACTER FORMAT "X(256)":U
     LABEL "Combo 1"
     VIEW-AS COMBO-BOX INNER-LINES 5
     LIST-ITEMS "Item 1","Item 2","Item 3","Item 4","Item 5"
     DROP-DOWN-LIST
     SIZE 16 BY 1
     FGCOLOR 9 NO-UNDO.

View attachment 3176

The only option I can think of is try removing the theme as outlined here and see if FGCOLOR works then:

We already tried that but the problem of the object visual old version remains. Do you know about any other workaround?
 
Sorry, unfortunately not. I was hoping that could have been the solution but seems you have tried that and do not know of any other option.
 
This code works for me:

Code:
run SetWindowTheme(COMBO-BOX-1:HWND, 0, "").

PROCEDURE SetWindowTheme EXTERNAL "uxtheme.dll":
    DEFINE INPUT PARAMETER hWnd AS LONG.
    DEFINE INPUT PARAMETER a AS LONG.
    DEFINE INPUT PARAMETER b AS CHARACTER.
END PROCEDURE.
 
Back
Top