text color in listbox

This is a discussion on text color in listbox within the Windows Programming forums, part of the Platform Specific Boards category; Hi, May i know if we are able to change the text color of the List Box when the listbox ...

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    8

    text color in listbox

    Hi,

    May i know if we are able to change the text color of the List Box when the listbox is created using MFC Dialog Box? For example, i have 10 items in the List Box. By default, the words are black in color.
    eg
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    Is there any ways i can change 1 or 2 items to another color, while the rest remain as black?

    eg
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    thanks for the help....
    wayne

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Please don't cross-post.

    If you haven't already done so then please take some time to familiarise yourself with the faq:
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

    Make sure you have a look at the the posting guidelines:
    http://cboard.cprogramming.com/annou...ouncementid=51
    Following the rules will ensure you get a prompt answer to your question.

    Remember, too, that the board has a search facility, a link is at the top of your screen:
    http://cboard.cprogramming.com/search.php
    It will often get you a quicker answer to your questions than waiting for a response to one you have posted.


    If you have any questions about this you may ask or you can contact one of our forum leaders:

    http://cboard.cprogramming.com/showgroups.php

    ***

    The answer given in your original thread is what you need, namely implementing an owner-drawn listbox. An example using mfc can be found here.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  2. How to use FTP?
    By maxorator in forum C++ Programming
    Replies: 8
    Last Post: 11-04-2005, 02:17 PM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. Replies: 1
    Last Post: 07-13-2002, 05:45 PM
  5. Getting FULL filename from listbox
    By Garfield in forum Windows Programming
    Replies: 8
    Last Post: 01-27-2002, 07:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21