Arkadaslar saygilar
Listviwide faturalar lista halinde tarihleriyle beraber sirali ve onlari renklendirmek istiyorum.
Asagidakini cumleyi asagidaki koda nasil uygulayabilirim?
Tarih, Bugun ‘e esit ise ------ Kirmizi
Tarih, Bugun’e esit degil ve 30 gunden kucuk ise ----- mavi ve ayrica 7 gunluk i ise ----- Sari
Tarih 30 gunden buyuk ise ----- kahaverengi
Private Sub FormatListView1()
Dim Item As ListItem
Dim Counter As Long
Dim Note As String
Dim Tarih As String
Dim Color As Long
Dim N As Long
' Set the variable to the ListItem.
For Counter = 1 To Me.ListView1.ListItems.Count
Set Item = Me.ListView1.ListItems.Item(Counter)
' Set the variable to the Freight
Note = Item.SubItems(17)
Tarih = Item.SubItems(18)
With Me.ListView1
If Note <> "" Then
If Tarih = Date Then
Color = vbMagenta
ElseIf Tarih <> Date And Tarih = Date > 30 Then
Color = vbRed
ElseIf Tarih <> Date And Tarih = Date < 30 Then
Color = vbBlue
End If
Else
Color = vbBlack
End If
Item.ForeColor = Color
For N = 1 To 20
Item.ListSubItems(N).ForeColor = Color
Next N
End With
Next Counter
Me.ListView1.Refresh
End Sub
Listviwide faturalar lista halinde tarihleriyle beraber sirali ve onlari renklendirmek istiyorum.
Asagidakini cumleyi asagidaki koda nasil uygulayabilirim?
Tarih, Bugun ‘e esit ise ------ Kirmizi
Tarih, Bugun’e esit degil ve 30 gunden kucuk ise ----- mavi ve ayrica 7 gunluk i ise ----- Sari
Tarih 30 gunden buyuk ise ----- kahaverengi
Private Sub FormatListView1()
Dim Item As ListItem
Dim Counter As Long
Dim Note As String
Dim Tarih As String
Dim Color As Long
Dim N As Long
' Set the variable to the ListItem.
For Counter = 1 To Me.ListView1.ListItems.Count
Set Item = Me.ListView1.ListItems.Item(Counter)
' Set the variable to the Freight
Note = Item.SubItems(17)
Tarih = Item.SubItems(18)
With Me.ListView1
If Note <> "" Then
If Tarih = Date Then
Color = vbMagenta
ElseIf Tarih <> Date And Tarih = Date > 30 Then
Color = vbRed
ElseIf Tarih <> Date And Tarih = Date < 30 Then
Color = vbBlue
End If
Else
Color = vbBlack
End If
Item.ForeColor = Color
For N = 1 To 20
Item.ListSubItems(N).ForeColor = Color
Next N
End With
Next Counter
Me.ListView1.Refresh
End Sub
