Enter the key on VB.NET Enter key instead of the TAB key

zhaozj2021-02-16  53

Implement the Enter key on VB.NET instead of the Tab key, with the following methods:

First set the form of the keypreview property for true

Then add the following code:

Private Sub FrmLogin_KeyPress (ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress' Enter replaced by Tab If e.KeyChar = Chr (13) Then e.Handled = True SendKeys.Send ( " {Tab} ") End if End Sub

转载请注明原文地址:https://www.9cbs.com/read-21962.html

New Post(0)