Problem:
Is it possible to colorize the ListViewItems with alternating colors?
Resolution:
To do this you have to derive your own list view class from the standard list view and use this class in the class control paragraph of your list view control program.
You find a sample "owndrawlistview" as attachment.
The "owndrawlistview" defines a method "wmGadgetNotify" which handles a redraw of the list view items in the desired style.
------------------------------------
To use the "owmdrawlistview" in your application, the class declaration in the control program has to be changed from
ListView is class "listview"
to
ListView is class "owndrawlistview"
and owndrawlistview class has to be added to the application
------------------------------------
The attached demo contains also a version of the owndrawlistview which colorizes the listview-items depending on there content.
------------------------------------
If the OwnDrawListView class and the VisualStyle (XP Style) are used in the same application, the GridLines may cause outlined ListViewItems.
The
* INVOKE aControl "GridLines"
should be commented out in the ListView control program.
This problem occurs on Windows XP and has been addressed by Microsoft. See:
http://support.microsoft.com/default.aspx?scid=kb;en-us;813791