Below is my code for 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
Everything works fine except when it focused on textbox. It leaves character “S” in the object. How can I fix this problem?
I just figured it out… I just assign a blank string to the
msgvariable and that’s it.