我想更改包含特定字符串的项目的颜色
Private Sub ListBox2_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles ListBox2.DrawItem
e.DrawBackground()
If DrawItemState.Selected.ToString.Contains("specific string") Then
e.Graphics.FillRectangle(Brushes.LightGreen, e.Bounds)
End If
e.DrawFocusRectangle()
那是我的代码,但不工作