Page 1 of 1

Combobox color

Posted: Thu Aug 16, 2012 3:19 pm
by Enrico Maria Giordano
I would find a way to assign a color to a combobox. The following sample only colors the boundaries of the combobox and its popup list:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oCbx, cItem := ""

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 1, 1 COMBOBOX oCbx VAR cItem;
           SIZE 300, NIL;
           ITEMS { "", "This is a test" };
           COLOR CLR_WHITE, CLR_HRED

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
Thank you in advance.

EMG

Re: Combobox color

Posted: Tue Aug 28, 2012 3:16 pm
by Enrico Maria Giordano
Any suggestions? :-)

EMG

Re: Combobox color

Posted: Wed Aug 29, 2012 8:00 am
by Eoeo
here run ok

Image



How it should be?

Re: Combobox color

Posted: Thu Aug 30, 2012 4:48 pm
by Enrico Maria Giordano
I forgot to mention that the problem shows up only when the manifest file is linked in. In such situation the combobox is not colored at all (except the dropdown part).

EMG

Re: Combobox color

Posted: Mon Sep 03, 2012 11:47 am
by Enrico Maria Giordano
Any ideas? I need to color the combobox. It was possible under XP but not under Vista and newer Windows releases.

EMG

Re: Combobox color

Posted: Tue Oct 16, 2012 2:07 pm
by Enrico Maria Giordano
Bump :-)

Re: Combobox color

Posted: Mon May 27, 2013 8:48 am
by Silvio.Falconi
Any solution ?

Re: Combobox color

Posted: Mon May 27, 2013 11:22 am
by Antonio Linares
Enrico,

If you are using themes then you are telling Windows to control the painting.

If you want to control the painting, try to create the combobox from the ON INIT clause of the dialog.

Re: Combobox color

Posted: Mon May 27, 2013 11:39 am
by Enrico Maria Giordano
Antonio Linares wrote:Enrico,

If you are using themes then you are telling Windows to control the painting.
Yes, but why I can change textbox color, even with themes?

EMG

Re: Combobox color

Posted: Mon May 27, 2013 3:32 pm
by Antonio Linares
Enrico,

Because Windows controls that painting and does not allows it. And you have authorized Windows to do it, telling it to use themes :-)

When you create a control from the ON INIT clause of ACTIVATE DIALOG, usually themes are not used (or they are not so restrictives).

Re: Combobox color

Posted: Mon May 27, 2013 4:53 pm
by Enrico Maria Giordano
Antonio,
Antonio Linares wrote:Enrico,

Because Windows controls that painting and does not allows it. And you have authorized Windows to do it, telling it to use themes :-)
Yes, I know. But my question was, why I can change textbox colors and cannot change combobox ones?

EMG

Re: Combobox color

Posted: Mon May 27, 2013 7:34 pm
by Antonio Linares
Enrico,

Because the themes change combobxes but on GETs only change the borders.

Windows themes change the appareance of the combos entirely, but not on the GETs.

Re: Combobox color

Posted: Mon May 27, 2013 7:43 pm
by Enrico Maria Giordano
Antonio,
Antonio Linares wrote:Enrico,

Because the themes change combobxes but on GETs only change the borders.

Windows themes change the appareance of the combos entirely, but not on the GETs.
Understood... :-(

EMG