Question : Alternating row colors for ListView in MS Access

How do you program the ListView in MS Access to have alternating row colors? Tied up with this - How do you change the font formatting i.e. color, size etc. for each row? I know how to do this in VB6 but not in MS Access.

Answer : Alternating row colors for ListView in MS Access

Here is a way to do what you want without trying to mke VB6 code work in Access;
Create an image using a paint program and load the image as the bacground picture for your ListView control.
Select Custom from the Ptoperties window of the ListView control and then the Picture tab.
If your Font is 8.25 (default setting), the image you create should be 28x28 pixels. If the font is 10 then use 34x34 pixels.
You will have to play a little to get the size right for different font sizes.
Paint the top half of the image one color and the bottom half another.
Set the Picture Alignment property to "Tiles the picture to fill the ListView background".
This will create a bacground that has alternates row colors.
bdb
Random Solutions  
 
programming4us programming4us