Silent D Software
2013-02-13T13:43:16Z
I have a VBA form with a grid. When I press tab to move from a control to the grid the grid area doesn't get the focus. If I press tab again then it does get the focus. It would appear that the headers might be taking the focus. Is there a way to have the focus appear in the grid right away?
Igor/10Tec
2013-02-13T14:44:34Z
I guess I know why this happens. When you press TAB the first time, iGrid does receive the focus, but it cannot indicate this as it has no current cell. When you press TAB the next time, iGrid moves the current cell from "nothing" to the first available cell (the top-left one), and you see the effect.

If you need to make the top-left cell selected automatically if there is no current cell when the input focus is moved to iGrid, in VBA you can use code like this:

Private Sub iGrid1_Enter()
   If iGrid1.CurRow = 0 Or iGrid1.CurCol = 0 Then
      iGrid1.SetCurCell 1, 1
   End If
End Sub

Sometimes, a grid can have no selected cell, and iGrid allows you to do that - that's why our iGrid behaves this way.