Option ExplicitPrivate Sub Form_Load()ListView1.FullRowSelect = True
ListView1.HideColumnHeaders = False
ListView1.TabStop = False
ListView1.Checkboxes = True
ListView1.LabelWrap = True
ListView1.HotTracking = True
ListView1.GridLines = True
ListView1.View = lvwReport
ListView1.HideSelection = False
ListView1.ColumnHeaders.Clear Dim i As Integer Dim j As Integer
Dim itmX As ListItem
Dim ColHead As ColumnHeader
ListView1.ColumnHeaders.Add , , "This is vb ListView"
ListView1.ColumnHeaders(1).Width = 3000
For j = 1 To 10000
Set itmX = ListView1.ListItems.Add()
itmX.Text = "Number" & CStr(j)
Next j
Picture1.BorderStyle = 1
Picture1.Appearance = 0
Picture1.ScaleMode = vbTwips
Picture1.AutoRedraw = True
Dim k As Long
Dim x As Double
Dim lineTop As Double
Dim lMatch As Single
Dim iHeight As Single
Dim tHeight As SingleDim p_h As Singlek = 0
Picture1.Font = ListView1.FontPicture1.Width = ListView1.Width
Picture1.Visible = FalselineTop = x * (3 - 1)
i = 964 '指定一行 If i = 1 Then lMatch = ListView1.ListItems(i).Top - ListView1.ListItems(i).Height
tHeight = ListView1.ListItems(i).Top - ListView1.ListItems(i).Height - lMatch
iHeight = ListView1.ListItems(i).Heightp_h = ListView1.ListItems(1).Height * (ListView1.ListItems.Count + 1)
If p_h - tHeight < iHeight Then
Picture1.Height = p_h + iHeight
Else
Picture1.Height = ListView1.ListItems(1).Height * (ListView1.ListItems.Count + 1)End IfDebug.Print tHeightDebug.Print Picture1.Height
Debug.Print Picture1.Height - tHeightPicture1.Line (0, tHeight)-(Picture1.Width, tHeight + iHeight), &H8080FF, BF ListView1.Picture = Picture1.ImageEnd Sub
上面和代码指定从1到963正常,指定964行就不行了。请各位发烧友帮帮看一下原因出在哪了。谢谢~~~~
ListView1.HideColumnHeaders = False
ListView1.TabStop = False
ListView1.Checkboxes = True
ListView1.LabelWrap = True
ListView1.HotTracking = True
ListView1.GridLines = True
ListView1.View = lvwReport
ListView1.HideSelection = False
ListView1.ColumnHeaders.Clear Dim i As Integer Dim j As Integer
Dim itmX As ListItem
Dim ColHead As ColumnHeader
ListView1.ColumnHeaders.Add , , "This is vb ListView"
ListView1.ColumnHeaders(1).Width = 3000
For j = 1 To 10000
Set itmX = ListView1.ListItems.Add()
itmX.Text = "Number" & CStr(j)
Next j
Picture1.BorderStyle = 1
Picture1.Appearance = 0
Picture1.ScaleMode = vbTwips
Picture1.AutoRedraw = True
Dim k As Long
Dim x As Double
Dim lineTop As Double
Dim lMatch As Single
Dim iHeight As Single
Dim tHeight As SingleDim p_h As Singlek = 0
Picture1.Font = ListView1.FontPicture1.Width = ListView1.Width
Picture1.Visible = FalselineTop = x * (3 - 1)
i = 964 '指定一行 If i = 1 Then lMatch = ListView1.ListItems(i).Top - ListView1.ListItems(i).Height
tHeight = ListView1.ListItems(i).Top - ListView1.ListItems(i).Height - lMatch
iHeight = ListView1.ListItems(i).Heightp_h = ListView1.ListItems(1).Height * (ListView1.ListItems.Count + 1)
If p_h - tHeight < iHeight Then
Picture1.Height = p_h + iHeight
Else
Picture1.Height = ListView1.ListItems(1).Height * (ListView1.ListItems.Count + 1)End IfDebug.Print tHeightDebug.Print Picture1.Height
Debug.Print Picture1.Height - tHeightPicture1.Line (0, tHeight)-(Picture1.Width, tHeight + iHeight), &H8080FF, BF ListView1.Picture = Picture1.ImageEnd Sub
上面和代码指定从1到963正常,指定964行就不行了。请各位发烧友帮帮看一下原因出在哪了。谢谢~~~~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货