Solved

gray out item in listbox

Posted on 1998-01-02
3
320 Views
Last Modified: 2013-11-20
I want to gray an item of a list box. Is this possible?
0
Comment
Question by:marcw
[X]
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
3 Comments
 
LVL 1

Expert Comment

by:Arkadiy
ID: 1313394
Short answer is: NO. You can use 3-rd party gadgets, list control(a new thing for Win95) or implement owner-drawn list box. All these solutions are a bit clumsy, but will do the trick.
0
 
LVL 3

Expert Comment

by:shaig
ID: 1313395
The way i found for dealing with this issue is to display a grayed
bitmap for the grayed item's.
This will work for a list-control  ( i don't know if a list-box can show bitmaps ), the list-control also has the capability of owner-drawing, maybe this can help you.
0
 
LVL 7

Accepted Solution

by:
galkin earned 100 total points
ID: 1313396
Yes you must create owner draw list box and perform custom drawing. Use GrayString to draw list box item gray text or use GetSysColor(COLOR_GRAYTEXT) to get gray text color, call SetTextColor() and then draw text using usual GDI  function DrawText or (Ext)TextOut.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 171
matchUp  challenge 6 82
wordmultiple challenge 12 167
"Black Box" Testing of Control System Software 2 122
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

740 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