vsflexgrid控件编辑数据时,按回车键移到下一行,如何实现,急等!!!我的代码如下:Private Sub VSFlexGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
With VSFlexGrid1
.Row = .Row + 1
End With
KeyAscii = 0
End If
End Sub但要按两次回车键才移动到下一行,怎么解决?
If KeyAscii = 13 Then
With VSFlexGrid1
.Row = .Row + 1
End With
KeyAscii = 0
End If
End Sub但要按两次回车键才移动到下一行,怎么解决?
解决方案 »
- 判断一个记录集为空的两种方法那个好?
- 怎让这个函数返回一个参数
- FSO问题之二,不能移动文件夹到别的盘中(如D盘的b文件夹无法移动到C盘)的问题!
- 请教:集合的使用说明?
- 有谁知道幻影2003的那幻影效果是如何实现的
- 谁会在VB下的并行计算或多线程应用程序的开发?
- 如何给软件定价?
- 为什么总是返回记录数为-1的呢?
- 各位大佬,急用啊,请问如何用SQL语句实现多表的某些字段的查询
- 【求助】读取 文本文件到 Text1 中时 如何显示进度条
- 我用WebBrowser控件显示Excel文件,但会出现一个对话框,说这个excel文件已被要求下载,这是为怎么?急.....
- 一个关于用户权限的问题,急!!!!!!!!
If KeyAscii = 13 Then
With VSFlexGrid1
.Row = .Row + 1
End With
KeyAscii = 0
End If
End Sub
上面的代码在vsflexgrid6.0中调试通过!
If KeyAscii = vbKeyReturn Then
VSFlexGrid1.Select VSFlexGrid1.Row + 1, VSFlexGrid1.Col
VSFlexGrid1.ShowCell VSFlexGrid1.Row + 1, VSFlexGrid1.Col
End If
End SubPrivate Sub VSFlexGrid1_KeyPressEdit(ByVal Row As Long, ByVal Col As Long, KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
VSFlexGrid1.Select Row + 1, Col
VSFlexGrid1.ShowCell Row + 1, Col
SendKeys "{F2}"
End If
End Sub全部分给我.
Private Sub VSFlexGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
VSFlexGrid1.Select VSFlexGrid1.Row + 1, VSFlexGrid1.Col
VSFlexGrid1.ShowCell VSFlexGrid1.Row + 1, VSFlexGrid1.Col
KeyAscii = 0
End If
End SubPrivate Sub VSFlexGrid1_KeyPressEdit(ByVal Row As Long, ByVal Col As Long, KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
VSFlexGrid1.Select Row + 1, Col
VSFlexGrid1.ShowCell Row + 1, Col
End If
End Sub
'-------按回车键移到下一行-----------------Private Sub VSFlexGrid1_AfterEdit(ByVal Row As Long, ByVal Col As Long)
VSFlexGrid1.Row = VSFlexGrid1.Row + 1 '按回车键移动到下一行
'End Sub
'-------------------------------------------