如何使Tabindex转到表单中的关闭按钮

发布于 2025-02-08 17:25:31 字数 113 浏览 0 评论 0原文

我的公司要求我将我的VB.NET应用程序友好,以友好使用键盘,叙述者等使用可访问性功能的人...

我注意到,当在键盘中使用选项卡时,焦点不会关闭表格中的按钮。有没有办法确保何时使用标签进入关闭按钮?

I have been asked by my company to make my vb.net app friendly to those who use accessibility features, like keyboard, narrator, etc...

I have noticed that when using tab in the keyboard, the focus do not go to the close button in the form. Is there a way to make sure when some one is using the tab to go to the close button?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等风来 2025-02-15 17:25:31

如果要通过键盘触发系统对话框,则可以在相关控件上检查选项卡键,然后使用sendkeys打开对话框。

  Private Sub TextBox2_PreviewKeyDown(sender As Object, e As PreviewKeyDownEventArgs) Handles TextBox2.PreviewKeyDown
      If e.KeyCode = 9 Then
          SendKeys.Send("% ")
      End If
  End Sub

If you want to trigger the system dialog through the keyboard you can check for a TAB key press on the control in question and then use SendKeys to pop the dialog open.

  Private Sub TextBox2_PreviewKeyDown(sender As Object, e As PreviewKeyDownEventArgs) Handles TextBox2.PreviewKeyDown
      If e.KeyCode = 9 Then
          SendKeys.Send("% ")
      End If
  End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文