Hi @Connor Frayne ,
You can set the OwnerDraw
property of the ListView
to True
. Then handle the DrawItem
event to custom draw the items.
Private Sub ListView1_DrawItem(sender As Object, e As DrawListViewItemEventArgs) Handles ListView1.DrawItem
If e.Item.Selected Then
e.Graphics.FillRectangle(Brushes.White, e.Bounds)
Else
e.DrawBackground()
End If
e.Graphics.DrawString(e.Item.Text, e.Item.Font, Brushes.Black, e.Bounds.Left, e.Bounds.Top)
If e.Item.ImageIndex >= 0 Then
Dim img As Image = ListView1.LargeImageList.Images(e.Item.ImageIndex)
e.Graphics.DrawImage(img, e.Bounds.Left, e.Bounds.Top)
End If
End Sub
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.