下面是我的 ProcessCmdKey 代码。
Public Class EmployeeStatus
Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean
Handl(msg, keyData, bNavi)
End Function
Public Function Handl(ByRef msg As Message, ByVal keyData As Keys, ByRef bNavi As BindingNavigator) As Boolean
Try
If keyData = (Keys.Control or Keys.S) Then
TBSave
Return True
end if
Catch ex As Exception
Return False
End Try
End Function
Public Function TBSave() as Boolean
Try
'Some code for saving to database
Catch ex As Exception
msgbox(ex.message)
End Try
End Function
End Class
一切正常,除非它专注于文本框。它在对象中留下字符“S”。我该如何解决这个问题?