textbox的值为空或没有更改时,按下回车键textbox会失去焦点

此时用textbox1.setfocus不能使textbox1重新获取焦点

 

Private Sub Textbox1_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbkeyreturn Then

KeyCode = 0

Textbox1.setfocus

End If

End Sub

相关文章:

  • 2021-12-01
  • 2022-03-06
  • 2022-02-17
  • 2021-12-22
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
猜你喜欢
  • 2022-12-23
  • 2021-06-24
  • 2021-11-02
  • 2021-08-21
  • 2021-07-17
  • 2022-12-23
相关资源
相似解决方案