源代码如下: Private Sub DataGrid1_Keyup(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then SendKeys "{right}" End If End Sub 在应用中按enter键可以转移到下一个单元格,可是没有办法看见光标,有什么办法可以使光标出现呢???
在datagrid 的RowColChange事件中
cur_col=datagrid1.col
在keypress中
Static i As Integer
i = 0
If KeyAscii = 13 Then
If i < cur_col + 1 Then
i = i + 1
SendKeys "{right}"
Else
i = i - 1
SendKeys "{down}"
End If
End If