Ver Mensaje Individual
  #5 (permalink)  
Antiguo 29/12/2010, 12:47
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: Backcolor de un registro específico del ListView

Navegando en la web encontré este codigo y funciona!!

1-Agrega un PictureBox
Propiedades:
Name=Pic
Autoredraw=true
BorderStyle=none
Backcolor=&H80000009& ' ES EL COLOR BLANCO
Visible=false

2-Agrega un ListView
Propiedades:
View=lvwReport
Labeledit=lvwManual
Checkboxes=true
Fullrowselect=true

3-Agrega el siguiente codigo:
Código vb:
Ver original
  1. Private Sub ListView_ItemCheck(ByVal Item As MSComctlLib.ListItem)
  2.     Dim i As Long
  3.     If ListView.ListItems.Count > 0 Then
  4.    
  5.         pic.Width = ListView.Width
  6.         pic.Height = ListView.ListItems(1).Height * (ListView.ListItems.Count)
  7.         pic.ScaleHeight = ListView.ListItems.Count
  8.         pic.ScaleWidth = 1
  9.         pic.DrawWidth = 1
  10.         pic.Cls
  11.         For i = 1 To ListView.ListItems.Count
  12.             If ListView.ListItems(i).Checked = True Then
  13.                 ListView.ListItems(i).Checked = True
  14.                 pic.Line (0, i - 1)-(1, i), &H80FFFF, BF
  15.             Else
  16.                 ListView.ListItems(i).Checked = False
  17.                 pic.Line (0, i - 1)-(1, i), &HFFFFFF, BF
  18.             End If
  19.         Next i
  20.        
  21.         ListView.Picture = pic.Image
  22.     Else
  23.         pic.Cls
  24.         ListView.Picture = pic.Image
  25.     End If
  26. End Sub

Nos Cuentas!!!