Click here to Skip to main content
6,630,586 members and growing! (15,503 online)
Email Password   helpLost your password?
Desktop Development » Combo & List Boxes » General     Beginner

Dynamically Highlight Elements in a List Control

By Coleman Brumley

Use the custom draw features of a List Control to dynamically find and hightlight items.
VC6Win2K, MFC, Dev
Posted:19 Aug 2001
Updated:20 Aug 2001
Views:111,783
Bookmarked:31 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
13 votes for this article.
Popularity: 5.28 Rating: 4.74 out of 5

1

2

3
1 vote, 10.0%
4
9 votes, 90.0%
5

Just type a name it gets highlighted!

Introduction

It seems more and more like my projects revolve around the List Control in some form or another. I also seem to be using CodeProject more and more to find out how to do things in my code.

One day, I came across Michael Dunn's excellent article Neat Stuff to do in List Controls Using Custom Draw and it got me to thinking about how to do some really functional stuff with a list control.

I had recently done a project where certain attributes were displayed in a list control. And, at the time, I thought it would be neat if I could color text in a column based on certain criteria, specifically, the text in the cell. Well, due to time constraints, that feature never made it into the project.

But, since then, I've had time to revisit, and have come up with that functionality in this little application.

Simply type in a name in the edit box, and if the name is found in the List Control, it's highlighted yellow and it's text is changed to red.

The specifics of Custom Draw in a List Control are presented in Michael's article, and I've tried to document the code nicely.

Enjoy!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Coleman Brumley


Member

Location: United States United States

Other popular Combo & List Boxes articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 10 of 10 (Total in Forum: 10) (Refresh)FirstPrevNext
GeneralGreat article! Pinmembermonimicki18:14 21 Oct '04  
GeneralGreat But PinsussJuha Kiviranta22:36 26 Jun '03  
GeneralRe: Great But PinmemberC_BRUMLEY18:12 15 Mar '06  
Generalfiltering Pinmemberbcengiz4:49 9 Oct '02  
GeneralVery usefull PinsussAnonymous6:15 30 Jul '02  
GeneralRe: Download PinmemberBrian V Shifrin13:08 20 Aug '01  
GeneralRe: Download PinmemberColeman Brumley18:38 20 Aug '01  
GeneralRe: Download PinmemberColeman Brumley19:13 20 Aug '01  
GeneralDownload PinmemberFilthyZombie4:33 20 Aug '01  
GeneralRe: Download PinsussAnonymous22:51 24 Jul '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 Aug 2001
Editor: Nishant Sivakumar
Copyright 2001 by Coleman Brumley
Everything else Copyright © CodeProject, 1999-2009
Web18 | Advertise on the Code Project