用sendmessage也不行,sendkeys更不可能!因为网格不接受键盘的上下箭头键自己解决了,主要代码如下: Private Sub text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 38 Then If GridTip.Row > 1 Then GridTip.Row = GridTip.Row - 1 GridTip.ColSel = 14 End If ElseIf KeyCode = 40 Then If GridTip.Row < GridTip.Rows - 1 Then GridTip.Row = GridTip.Row + 1 GridTip.ColSel = 14 End If End If
照你这样的讲法,excel也做不到吧
Private Sub text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 38 Then
If GridTip.Row > 1 Then
GridTip.Row = GridTip.Row - 1
GridTip.ColSel = 14
End If
ElseIf KeyCode = 40 Then
If GridTip.Row < GridTip.Rows - 1 Then
GridTip.Row = GridTip.Row + 1
GridTip.ColSel = 14
End If
End If
End Sub送分了!