Click here to Skip to main content
12,621,744 members (36,797 online)
Rate this:
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 4: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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.161128.1 | Last Updated 28 Nov 2012
Copyright © CodeProject, 1999-2016
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