16,555
社区成员
发帖
与我相关
我的任务
分享
Private Sub ListBox1_DrawItem(sender As Object, e As DrawItemEventArgs) Handles ListBox1.DrawItem
Dim bg As Brush = Brushes.White
Dim fColor As Brush = Brushes.Black
If e.State And DrawItemState.Selected = DrawItemState.Selected Then
bg = Brushes.Black
fColor = Brushes.White
End If
e.Graphics.FillRectangle(bg, e.Bounds)
e.Graphics.DrawString(ListBox1.Items(e.Index), Me.Font, fColor, e.Bounds)
End Sub