I know there are a lot of discussions regarding this question out there. Unfortunately the most for VB.net. I am using Access 2007 and the ActiveX ListView control. So far it's working fine. Except setting the back ground color for an subitem or a column is not working.
[EDIT]
To be more specific. In VB the following should work:
editListView1.Items(i).UseItemStyleForSubItems = false
editListView1.Items(i).SubItems(8).BackColor = Color.LightGray
Unfortunately in VBA the "items" property is not available. If i use editListView1.ListItems(i).UseItemStyleForSubItems
, I get an error.
on the other hand changing the fore color works without any problem:
objListView.ListItems.Item(intRowCount).ListSubItems.Item(intColCount).ForeColor = vbRed
I really would appreciate your help.
Thanks
Assuming your using the Microsoft Listview Control from mscomctl/comctl32.ocx
then you cannot set the background colour of an individual row or sub-item, you can only set the foreground colour .
The only way around that is to go through the tedious steps of custom drawing it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.