Hi,
Add a timer and set the interval 2000, then try something like this:
Code:
Dim i, j As Integer
For i = 0 To DataGridView1.RowCount - 1
j += Me.DataGridView1.Rows(i).Cells("Amount").Value
Next
If j > 150 Then
Me.DataGridView1.Rows(2).Cells("Amount").Style.BackColor = Color.Red
Timer1.Start()
End If
TextBox1.Text = j.ToString
Then in the timer event something like this:
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.DataGridView1.Rows(2).Cells("Amount").Style.BackColor = Color.Red then
Me.DataGridView1.Rows(2).Cells("Amount").Style.BackColor = Color.Blue
else
Me.DataGridView1.Rows(2).Cells("Amount").Style.BackColor = Color.Red
End If
End Sub
I didn't tested!