Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

gray out item in listbox

Posted on 1998-01-02
3
Medium Priority
?
324 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 300 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 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