Ciao a tutti, ho un problema con le listview, ogni volta che applico una qualsiasi modifica sfarfalla, in inglese usano il termine flicker, non ho trovato una soluzione, voi avete qualche consiglio da darmi?
vi posto il codice di una delle modifiche che faccio alla listview, cambio il colore di un subItem
codice:
Private Sub AvantiTAB()
ListViewGestione.BeginUpdate()
If IndiceSelezione = 101 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(1).ForeColor = Color.Lime
ListViewGestione.Items(IndiceGruppo - 1).SubItems(1).BackColor = Color.Black
ElseIf IndiceSelezione = 102 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(2).ForeColor = Color.Red
ListViewGestione.Items(IndiceGruppo - 1).SubItems(2).BackColor = Color.Black
ElseIf IndiceSelezione = 103 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(3).ForeColor = Color.Fuchsia
ListViewGestione.Items(IndiceGruppo - 1).SubItems(3).BackColor = Color.Black
ElseIf IndiceSelezione = 104 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(4).ForeColor = Color.Fuchsia
ListViewGestione.Items(IndiceGruppo - 1).SubItems(4).BackColor = Color.Black
ElseIf IndiceSelezione = 105 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(5).ForeColor = Color.Orange
ListViewGestione.Items(IndiceGruppo - 1).SubItems(5).BackColor = Color.Black
ElseIf IndiceSelezione = 106 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).ForeColor = Color.White
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).BackColor = Color.Black
ElseIf IndiceSelezione = 107 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).ForeColor = Color.Lime
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).BackColor = Color.Black
End If
IndiceGruppo = IndiceGruppo + 1
If IndiceGruppo > NumeroMassimoGruppi Or IndiceGruppo + Indice > LunghezzaMassima Then
IndiceGruppo = 1
End If
If IndiceSelezione = 101 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(1).ForeColor = Color.Black
ListViewGestione.Items(IndiceGruppo - 1).SubItems(1).BackColor = Color.White
ElseIf IndiceSelezione = 102 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(2).ForeColor = Color.Black
ListViewGestione.Items(IndiceGruppo - 1).SubItems(2).BackColor = Color.White
ElseIf IndiceSelezione = 103 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(3).ForeColor = Color.Black
ListViewGestione.Items(IndiceGruppo - 1).SubItems(3).BackColor = Color.White
ElseIf IndiceSelezione = 104 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(4).ForeColor = Color.Black
ListViewGestione.Items(IndiceGruppo - 1).SubItems(4).BackColor = Color.White
ElseIf IndiceSelezione = 105 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(5).ForeColor = Color.Black
ListViewGestione.Items(IndiceGruppo - 1).SubItems(5).BackColor = Color.White
ElseIf IndiceSelezione = 106 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).ForeColor = Color.Black
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).BackColor = Color.White
ElseIf IndiceSelezione = 107 Then
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).ForeColor = Color.Black
ListViewGestione.Items(IndiceGruppo - 1).SubItems(6).BackColor = Color.White
End If
ListViewGestione.EndUpdate()
IndiceSelezione = 101
End Sub
Per completezza vi dico che questa listview ha 8 colonne, ma la colonna 0 non la uso e può arrivare ad avere 28 righe.
attendo vostri consigli