Torna al Thread

Dim lista As New Dictionary(Of DataGridViewCell, String) Dim valoreTemp As String Private Sub DataGridView1_CellBeginEdit(ByVal sender As DataGridView, ByVal e As System.Windows.Forms.DataGridViewCellCancelEventArgs) Handles DataGridView1.CellBeginEdit valoreTemp = sender.CurrentCell.Value.ToString End Sub Private Sub DataGridView1_CellEndEdit(ByVal sender As DataGridView, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit If (valoreTemp = sender.CurrentCell.Value.ToString) = False Then If lista.Keys.Contains(sender.CurrentCell) = False Then lista.Add(sender.CurrentCell, valoreTemp) End If End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For Each cella As DataGridViewCell In lista.Keys If (cella.Value.ToString = lista(cella)) = False Then cella.Style.BackColor = Color.Yellow Else cella.Style.BackColor = Color.White End If Next End Sub
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5