Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

gray out item in listbox

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

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

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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Loops Section Overview
Suggested Courses

810 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