Private Sub DataGridView1_CurrentCellChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGridView1.CurrentCellChanged
Dim colIndex As Integer = Me.DataGridView1.CurrentCellAddress.X
If colIndex = 1 OrElse colIndex = 3 Then
SendKeys.Send("{TAB}")
End If
End Sub
That's what I thought, but if you set the CurrentCell property explicitly in the CellEnter or CurrentCellChanged event handler you get an exception thrown because of an illegal recursive call. I said that a couple of posts ago and drmike said he experienced the same thing.UncleRonin said:SendKeys is pretty useful in some situations. For the whole datagridview thing, what you want to do is really easy isnt it? you dont HAVE to use sendkeys either (especially if you ever disabled tabbing). In the currentcellchanged event (focus event possibly) just programmitcally set the focus to the next cell. There are plenty of workarounds for this, and sendkeys is the easiest option