my DGV enable adding = false
here is my code so far, it's work, but when reach last row it will stop :
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i As Integer = 0 To 5
DataGridView1.Rows.Add("test")
Next
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If DataGridView1.Rows.Count = 0 Then
ElseIf DataGridView1.CurrentRow.Index = DataGridView1.Rows.Count - 1 Then
DataGridView1.Rows(0).Selected = True
Else
Dim nextRow As DataGridViewRow = DataGridView1.Rows(DataGridView1.CurrentRow.Index + 1)
DataGridView1.CurrentCell = nextRow.Cells(0)
nextRow.Selected = True
End If
End Sub
This post has been edited by artemix22: 05 October 2012 - 01:38 AM

New Topic/Question
Reply



MultiQuote



|