Combobox color

Post Reply
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Combobox color

Post 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
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Combobox color

Post by Eoeo »

here run ok

Image



How it should be?
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Combobox color

Post 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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Combobox color

Post 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
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Combobox color

Post by Silvio.Falconi »

Any solution ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Combobox color

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Combobox color

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Combobox color

Post 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).
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Combobox color

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Combobox color

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Combobox color

Post 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
Post Reply