如何在 TextBox 上捕获返回命中(输入)?
以下不起作用。我不断收到错误“找不到 KeyPress 事件”。
Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox.KeyPress
If TextBox.Text Is Nothing Then Return
If TextBox.Text.Length = 6 And Asc(e.KeyChar) = 13 Then
' Do something here
End If
End Sub