Private Sub MSFlexGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 39 Then '右移键
If MSFlexGrid1.Col = MSFlexGrid1.Cols - 1 Then
MSFlexGrid1.Col = 0
Else
MSFlexGrid1.Col = MSFlexGrid1.Col + 1
End If
Call Text1_Keyd
ElseIf KeyCode = 37 Then '左移键
If MSFlexGrid1.Col = 0 Then
MSFlexGrid1.Col = MSFlexGrid1.Cols - 1
Else
MSFlexGrid1.Col = MSFlexGrid1.Col - 1
End If
Call Text1_Keyd
ElseIf KeyCode = 38 Then '上移键
If MSFlexGrid1.Row = 0 Then
MSFlexGrid1.Row = MSFlexGrid1.Rows - 1
Else
MSFlexGrid1.Row = MSFlexGrid1.Row - 1
End If
Call Text1_Keyd
ElseIf KeyCode = 40 Or KeyCode = 13 Then '下移键或回车
If MSFlexGrid1.Row = MSFlexGrid1.Rows - 1 Then
MSFlexGrid1.Row = 0
Else
MSFlexGrid1.Row = MSFlexGrid1.Row + 1
End If
Call Text1_Keyd
End If
End Sub
这是不是你要的?