Merhaba arkadaslar
Asagidaki kodla listview'de renklendirme yapiyorum. Ayni renkte olanlari siralama sansimiz varmi?
Private Sub FormatListView1()
Dim Item As ListItem
Dim Counter As Long
Dim Note As String
Dim Tarih As Date
Dim iColor As Long
Dim N As Integer
For Counter = 1 To Me.ListView1.ListItems.Count
Set Item = Me.ListView1.ListItems.Item(Counter)
iColor = vbBlack
Note = Item.SubItems(17)
If Item.SubItems(18) = "" Then GoTo 2
Tarih = Item.SubItems(18)
With Me.ListView1
If Note <> "" Then
If Tarih > Date Then GoTo 2
Select Case Tarih
Case Is < Date - 30: iColor = vbMagenta
Case Date - 7: iColor = vbGreen
Case Date - 30 To Date - 1: iColor = vbBlue
Case Is = Date: iColor = vbRed
End Select
End If
Item.ForeColor = iColor
For N = 1 To 18
Item.ListSubItems(N).ForeColor = iColor
Next N
2:
End With
Next Counter
End Sub
Saygilar sunuyorum
Asagidaki kodla listview'de renklendirme yapiyorum. Ayni renkte olanlari siralama sansimiz varmi?
Private Sub FormatListView1()
Dim Item As ListItem
Dim Counter As Long
Dim Note As String
Dim Tarih As Date
Dim iColor As Long
Dim N As Integer
For Counter = 1 To Me.ListView1.ListItems.Count
Set Item = Me.ListView1.ListItems.Item(Counter)
iColor = vbBlack
Note = Item.SubItems(17)
If Item.SubItems(18) = "" Then GoTo 2
Tarih = Item.SubItems(18)
With Me.ListView1
If Note <> "" Then
If Tarih > Date Then GoTo 2
Select Case Tarih
Case Is < Date - 30: iColor = vbMagenta
Case Date - 7: iColor = vbGreen
Case Date - 30 To Date - 1: iColor = vbBlue
Case Is = Date: iColor = vbRed
End Select
End If
Item.ForeColor = iColor
For N = 1 To 18
Item.ListSubItems(N).ForeColor = iColor
Next N
2:
End With
Next Counter
End Sub
Saygilar sunuyorum
