How to gray out String in CComboBox

Posted on 2002-07-24
Last Modified: 2013-11-20
I use AddString to add particular strings to the edit box of a combobox and now i want to gray out particular strings. How would i do this?
Question by:fatassrat
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 12

Accepted Solution

migel earned 25 total points
ID: 7175438
There are no standrad styles APIs classes for such tasks
but you can derive your own class from CComboBox and use OwnerDraw mechanism to solve your problem.
Do you want also disable combo`s edit field for grayed strings?

Author Comment

ID: 7175476
Yes i want the strings grayed out and disabled
Is there an easier way besides using OwnerDraw?

Expert Comment

ID: 7175657
no, but here is the link to control that impelements what functionality....

hope it helps...

Assisted Solution

mblat earned 25 total points
ID: 7175973

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL ( and MongoDB (…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question