Click here to Skip to main content
11,811,971 members (69,948 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ API
createwindow("listbox", ~~)
it's gonna show a listbox with several lists that I store.
Assuming that there are below lists in listbox.


what I want to do is to change name color only for Jane. generally it's black.
and is it possible that I can put data in specific line such as second line or seventh line skipping blank lines.
Please, give your advice
Posted 28-Nov-12 3:39am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Yes, possible by using an ownerdrawn CListBox.

You need to use the LBS_OWNERDRAWVARIABLE (or LBS_OWNERDRAWFIXED ) and other owner drawn related flags when creating the control, and after than you have to handle the DrawItem and MeasureItem stuff.

I don't know how that works exacly in straight Win32, but I think it's a good start.

Richard MacCutchan at 28-Nov-12 11:30am
Yes, it is a good start.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 KrunalRohit 319
1 Abhinav S 215
2 Palash Mondal_ 210
3 CHill60 180
4 CPallini 135
0 OriginalGriff 3,893
1 KrunalRohit 2,441
2 CPallini 2,240
3 Maciej Los 2,155
4 ppolymorphe 1,725

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 28 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100