Pude descubrir la solución jeje para agregar lineas como un grid en un LISTBOX.
Código PHP:
Private Sub listbox_DrawItem(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DrawItemEventArgs) Handles listbox.DrawItem
Dim g As Graphics = e.Graphics
Dim br As SolidBrush
Dim s As String
Dim myBrush As Brush
Try
s = listbox.Items.Item(e.Index).ToString
'Se necesita agregar un color cada dos lineas'
Select Case (e.Index Mod 2)
Case 0
myBrush = Brushes.Blue
Case 1
myBrush = Brushes.Black
End Select
Catch ex As Exception
Trace.WriteLine(ex.ToString)
s = "error"
End Try
'Colorea el fondo de la linea'
g.FillRectangle(Brushes.AliceBlue, e.Bounds)
'Dibuja lineas como un grid en el listbox y despues le colorea el fondo'
Select Case (e.Index Mod 2)
Case 0
g.FillRectangle(Brushes.AliceBlue, e.Bounds)
g.DrawRectangle(Pens.Black, e.Bounds)
Case 1
g.FillRectangle(Brushes.White, e.Bounds)
g.DrawRectangle(Pens.Black, e.Bounds)
End Select
'Cuando esta seleccionado, dibuja las lineas del grid mas el color de seleccion'
If CBool(e.State And DrawItemState.Selected) Then
g.DrawRectangle(Pens.Black, e.Bounds)
g.FillRectangle(Brushes.Gold, e.Bounds)
g.DrawRectangle(Pens.Black, e.Bounds)
End If
br = New SolidBrush(Color.Black)
g.DrawString(s, listbox.Font, myBrush, RectangleF.op_Implicit(e.Bounds))
br.Dispose()
End Sub
Espero le puedan servir.