5,696,038 members and growing! (14,561 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.
VC6, C++Windows, NT4, Win2K, MFC, VS6, Visual Studio, Dev

Posted: 19 Aug 2001
Updated: 20 Aug 2001
Views: 100,161
Bookmarked: 24 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
12 votes for this Article.
Popularity: 5.10 Rating: 4.72 out of 5
0 votes, 0.0%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
1 vote, 11.1%
4
8 votes, 88.9%
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



Location: United States United States

Other popular Combo & List Boxes articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 10 of 10 (Total in Forum: 10) (Refresh)FirstPrevNext
GeneralGreat article!membermonimicki18:14 21 Oct '04  
GeneralGreat ButsussJuha Kiviranta22:36 26 Jun '03  
GeneralRe: Great ButmemberC_BRUMLEY18:12 15 Mar '06  
Generalfilteringmemberbcengiz4:49 9 Oct '02  
GeneralVery usefullsussAnonymous6:15 30 Jul '02  
GeneralRe: DownloadmemberBrian V Shifrin13:08 20 Aug '01  
GeneralRe: DownloadmemberColeman Brumley18:38 20 Aug '01  
GeneralRe: DownloadmemberColeman Brumley19:13 20 Aug '01  
GeneralDownloadmemberFilthyZombie4:33 20 Aug '01  
GeneralRe: DownloadsussAnonymous22: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-2008
Web07 | Advertise on the Code Project