how do i change the colour of the text in a combo box 
Author Message
 how do i change the colour of the text in a combo box

hi,
 how do i change the colour of the text in a combo box?
--
Neil Devlin


Mon, 20 Aug 2001 03:00:00 GMT  
 how do i change the colour of the text in a combo box
You should be able to override OnCtrlColor, test for the control's ID, and
use the CDC to
SetTextColor();

Keith

Quote:

>hi,
> how do i change the colour of the text in a combo box?
>--
>Neil Devlin



Mon, 20 Aug 2001 03:00:00 GMT  
 how do i change the colour of the text in a combo box
You can change color of all texts in  handler of WM_CTLCOLOR. However, if
you need to change color of each indiviual item, you need to do Custom
Drawing(NM_CUSTOMDRAW).

--
Ajay Kalra

Quote:

>hi,
> how do i change the colour of the text in a combo box?
>--
>Neil Devlin



Mon, 20 Aug 2001 03:00:00 GMT  
 how do i change the colour of the text in a combo box
Neil!

You will want to check the WM_CTLCOLOR message, and also, from the online
help:

OnCtlColor will not be called for the list box of a drop-down combo box
because the drop-down list box is actually a child of the combo box and not
a child of the window. To change the color of the drop-down list box, create
a CComboBox with an override of OnCtlColor that checks for CTLCOLOR_LISTBOX
in the nCtlColor parameter. In this handler, the SetBkColor member function
must be used to set the background color for the text.

Johan Rosengren
Responsable Informatique
PACTA S.A.

Neil Devlin a crit dans le message ...

Quote:
>hi,
> how do i change the colour of the text in a combo box?
>--
>Neil Devlin



Thu, 23 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Changing text colour in disabled edit box.

2. Colour combo box used in Windows desktop

3. List with columns containing both text and combo boxes / check boxes

4. Changing the text and background colour of single row in CListView

5. Need help changing the text colour of button controls

6. change the default colour of selected text

7. changing colour for text in a static textbox

8. Change Colour of a push button and Groups box

9. Changing text background colour in a Edit control

10. Changing an edit box's background colour

11. changing text colour in a CTreeCtrl

12. Changing the colour of Text selection in a CEdit derived class

 

 
Powered by phpBB® Forum Software