Private Sub PonColorEnElFondo(IndexFacturado As Long, IndexAlbaran As Long, IndexpeDiDo As Long, IndexPto As Long)
10 With ListViewEconomia
'If Item.Checked = True Then
' .ListItems(Item.Index).SubItems(4) = 1
'Else
' .ListItems(Item.Index).SubItems(4) = 0
'End If
Dim I As Long
On Error GoTo VerError:
'\\ make sure there is data to work with
20 If .ListItems.Count > 0 Then
30 picBG.Width = .Width
40 picBG.Height = .ListItems(1).Height * (.ListItems.Count)
50 picBG.ScaleHeight = .ListItems.Count
60 picBG.ScaleWidth = 1
70 picBG.DrawWidth = 1
80 picBG.Cls
90 For I = 1 To .ListItems.Count
100 Select Case I
Case IndexFacturado
110 If V_Colores.TipoDoc.Facturado = 0 Then
120 picBG.Line (0, I - 1)-(1, I), &H80FFFF, BF
130 Else
140 picBG.Line (0, I - 1)-(1, I), V_Colores.TipoDoc.Facturado, BF
150 End If
160 Case IndexAlbaran
170 If V_Colores.TipoDoc.Albaran = 0 Then
180 picBG.Line (0, I - 1)-(1, I), vbCyan, BF
190 Else
200 picBG.Line (0, I - 1)-(1, I), V_Colores.TipoDoc.Albaran, BF
210 End If
220 Case IndexpeDiDo
230 If V_Colores.TipoDoc.Pedido = 0 Then
240 picBG.Line (0, I - 1)-(1, I), vbMagenta, BF
250 Else
260 picBG.Line (0, I - 1)-(1, I), V_Colores.TipoDoc.Pedido, BF
270 End If
280 Case IndexPto
290 If V_Colores.TipoDoc.PRESUPUESTO = 0 Then
300 picBG.Line (0, I - 1)-(1, I), GetColorPastel(vbRed), BF
310 Else
320 picBG.Line (0, I - 1)-(1, I), V_Colores.TipoDoc.PRESUPUESTO, BF
330 End If
340 Case Else
350 picBG.Line (0, I - 1)-(1, I), &HFFFFFF, BF
360 End Select
370 Next I
380 .Picture = picBG.Image
390 Else
400 picBG.Cls
410 picBG.Height = 0
420 picBG.Width = 0
430 .Picture = picBG.Image
440 End If
450 End With
460 Exit Sub
VerError:
470 VerError "Error al poner colores en datos. Linea:" & Erl
End Sub