这个例子中还有一段代码,当中-= 和 +=有什么特殊意义?我觉得和&有点不太一样,请老师解释下。
还有这两行代码
ElseIf e.KeyCode = Keys.Enter
msgbox(1)
代码按下回车键,为什么是要弹出messagebox?可是当我按下回车键,也没有提示1啊?
谢谢老师!
表A_KeyDownEdit
If e.Col.Name = "第一列" Then '如果编辑的是客户 ID列
If e.Col.DroppedDown Then '如果下拉窗口已经打开
Dim lsx As WinForm.ListBox = Forms(e.Col.DropForm).Controls("ListBox1")
If e.KeyCode = Keys.Up Then '如果按下的是上箭头按键
If lsx.SelectedIndex > 0 Then
lsx.SelectedIndex -= 1
End If
e.Cancel = True
ElseIf e.KeyCode = Keys.Down Then '如果按下的是下箭头按键
If lsx.SelectedIndex < lsx.Items.Count - 1 Then
lsx.SelectedIndex += 1
End If
e.Cancel = True
ElseIf e.KeyCode = Keys.Enter
msgbox(1)
End If
End If
End If