vb转vb.net
'給ListView間隔顏色
Public Sub SetListBKColor(ByRef Lv As System.Windows.Forms.ListView, ByRef PicBg As System.Windows.Forms.PictureBox)
Dim i As Short
Lv.Parent.ScaleMode = vbTwips
Lv.ForeColor = System.Drawing.ColorTranslator.FromOle(&H403D39)
With PicBg
.BackColor = Lv.BackColor
.ScaleMode = vbTwips
.BorderStyle = System.Windows.Forms.FormBorderStyle.None
.AutoRedraw = True
.Visible = False
.Width = VB6.TwipsToPixelsX(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width)
.ScaleWidth = 1
.DrawWidth = 1
If Lv.Items.Count > 100 Then
.Height = VB6.TwipsToPixelsY(Lv.Items.Item(1).Height * Lv.Items.Count)
.ScaleHeight = Lv.Items.Count
For i = 1 To Lv.Items.Count
If i Mod 2 = 0 Then
PicBg.Line (0, i - 1) - (1, i), &HFBF9F8, BF
Else
PicBg.Line (0, i - 1) - (1, i), &HF4EFEC, BF
End If
Next
Else
.Height = VB6.TwipsToPixelsY(225.0709 * 100)
.ScaleHeight = 100
For i = 1 To 100
If i Mod 2 = 0 Then
PicBg.Line (0, i - 1) - (1, i), &HFBF9F8, BF
Else
PicBg.Line (0, i - 1) - (1, i), &HF4EFEC, BF
End If
Next
End If
Lv.Picture = .Image
End With
End Sub
我做的是VB转VB.net 不知道这些改如何替换。 内部高度设置 怎么也找不到,还有这个画图的颜色以及BF