Private Sub f01CurrencyEdit_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Try
Select Case e.KeyCode
Case Keys.Return //这里是回车
If vEnterEnabled <> True Then System.Windows.Forms.SendKeys.Send("{TAB}")
Case Keys.Escape
If btnCancel.Visible = True Then
Call btnCancel_Click(sender, e)
ElseIf btnExit.Enabled = True Then
Call btnExit_Click(sender, e)
End If
Case Keys.F10
e.Handled = True
Call btnSave_Click(sender, e)
End Select
Catch ex As Exception
MsgBox("<f01CurrencyEdit.f01CurrencyEdit_KeyDown> " & ex.Message)
End Try
End Sub
------------------------
Private Sub txtDescription_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtDescription.GotFocus
vEnterEnabled = True
txtDescription.SelectionStart = 0
End Sub
----------------------------------------
Private Sub txtDescription_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtDescription.LostFocus
vEnterEnabled = False
End Sub
Try
Select Case e.KeyCode
Case Keys.Return //这里是回车
If vEnterEnabled <> True Then System.Windows.Forms.SendKeys.Send("{TAB}")
Case Keys.Escape
If btnCancel.Visible = True Then
Call btnCancel_Click(sender, e)
ElseIf btnExit.Enabled = True Then
Call btnExit_Click(sender, e)
End If
Case Keys.F10
e.Handled = True
Call btnSave_Click(sender, e)
End Select
Catch ex As Exception
MsgBox("<f01CurrencyEdit.f01CurrencyEdit_KeyDown> " & ex.Message)
End Try
End Sub
------------------------
Private Sub txtDescription_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtDescription.GotFocus
vEnterEnabled = True
txtDescription.SelectionStart = 0
End Sub
----------------------------------------
Private Sub txtDescription_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtDescription.LostFocus
vEnterEnabled = False
End Sub