Cui Zhanmin gave the implementation code in its article "The line of code to realize the ListView control", after the author test, found that there is a bug:
First, although the background color interval can be seen, the height of the strip is equal to the height of the original PicgreenBar. The Height property is set to a minimum, such as 1, should be set to TRUE before the AutoRedRAW property is set.
In addition, ListView's attributes should be modified: ... listView1.view = lvwreport listview1.fullrowselect = true listview1.gridlines = true picgreenbar.height = 1 'Add some experimental data ....
For the convenience of readers, all code will be published as follows (key code from "implementing the line interval color of the ListView control":
--------------------------------
VERSION 5.00Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1} # 2.0 # 0"; "MSCOMCTL.OCX" Begin VB.Form Form1 Caption = "Form1" ClientHeight = 5400 ClientLeft = 60 ClientTop = 345 ClientWidth = 5940 LinkTopic = "Form1" ScaleHeight = 5400 ScaleWidth = 5940 StartUpPosition = 3 Begin VB.PictureBox picGreenbar Height = 1695 Left = 120 ScaleHeight = 1282.353 ScaleMode = 0 'User ScaleWidth = 4635 TabIndex = 1 Top = 3480 Width = 4695 End Begin MSComctlLib.ListView ListView1 Height = 3255 left = 120 TabINDEX = 0 TOP = 120 width = 4695 _extentx = 8281 _extenty = 5741 view = 3 sorted = -1 'true labelwrap = -1' true hideseelection = -1 'True FlatScrollBar = -1' True FullRowSelect = -1 'True GridLines = -1' True _Version = 393217 ForeColor = -2147483640 BackColor = -2147483643 BorderStyle = 1 Appearance = 1 NumItems = 0 EndEndAttribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = Falsettribute vb_creatable = falsettribute vb_predeclaredid = truettribute vb_exposed =