急啊 急啊 分可以在加鼠标在表里运行的问题

hepengwei 2003-05-08 03:14:05
鼠标在单元格出现
记录不能跳行输入
我的代码是如下
谁有类似的或帮我挑挑毛病
rivate Sub SGrid_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)
' If SGrid.ActiveRow > lrow Then
' SGrid.Row = SGrid.ActiveRow
' SGrid.Col = SGrid.ActiveCol
' If Len(Trim(SGrid.Text)) <> 0 Then
' lrow = SGrid.ActiveRow
' End If
' End If
'
' Select Case SGrid.ActiveCol
' Case 1, 2, 3, 4
' SGrid.Row = SGrid.ActiveRow
' SGrid.Col = SGrid.ActiveCol
' If Len(Trim(SGrid.Text)) = 0 Then
' SGrid.SetFocus
'' SGrid.Action = 0
' Exit Sub
' End If
' End Select
'End Sub

'Private Sub SGrid_LeaveRow(ByVal Row As Long, ByVal RowWasLast As Boolean, ByVal RowChanged As Boolean, ByVal AllCellsHaveData As Boolean, ByVal NewRow As Long, ByVal NewRowIsLast As Long, Cancel As Boolean)
' For i = 1 To NewRow - 1
' SGrid.Row = 1
' SGrid.Col = 1
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 2
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 3
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 4
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
'End Sub
...全文
107 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
czwwh 2003-05-13
  • 打赏
  • 举报
回复
恭喜恭喜,有进步。
之前多自己想想办法,你就可以省100分。
hepengwei 2003-05-13
  • 打赏
  • 举报
回复
我自己解决了
czwwh 2003-05-08
  • 打赏
  • 举报
回复
根本看不懂,用的是哪一个表格控件?
整个代码都没有注释,谁知道你要达到什么目标?

1,066

社区成员

发帖
与我相关
我的任务
社区描述
VB 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧