Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub ComboBox1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles ComboBox1.DrawItem
e.DrawBackground()
Dim backbrsh As Brush
Dim forebrsh As Brush = Brushes.Black
Dim rect As New RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height)
Select Case e.Index
Case 0
backbrsh = Brushes.White
Case 1
backbrsh = Brushes.Yellow
Case 2
backbrsh = Brushes.Pink
Case Else
backbrsh = Brushes.Green
End Select
e.Graphics.FillRectangle(backbrsh, rect)
e.Graphics.DrawString(ComboBox1.Items(e.Index).ToString, e.Font, forebrsh, rect)
End Sub