本文介绍了如何使用三个不同的键,例如(Ctrl Shift O)在vb.net中打开表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用三个不同的键,例如( + + )在vb.net中打开另一种形式. /p>

请帮助我.

解决方案

在keydown事件中,您可以访问这些键.例如,在此处理程序中...

Private Sub keyDown(ByVal Sender As Object, ByVal e As KeyEventArgs) handles me.keydown

...您可以使用布尔e.Alt,e.Control和e.Shift来判断这些控制键是否按下.然后您可以执行以下操作:

Select case CInt(e.keycode)
  case Keys.F12
    if e.Control andalso e.Shift then frm.ShowDialog
    ...

I need to use three different keys e.g, ( + + ) to open another form in vb.net.

Please help me.

解决方案

In the keydown event you can access these keys. For example, in this handler...

Private Sub keyDown(ByVal Sender As Object, ByVal e As KeyEventArgs) handles me.keydown

...you can use the booleans e.Alt, e.Control, and e.Shift to tell whether those control keys are down. Then you can do something like this:

Select case CInt(e.keycode)
  case Keys.F12
    if e.Control andalso e.Shift then frm.ShowDialog
    ...

这篇关于如何使用三个不同的键,例如(Ctrl Shift O)在vb.net中打开表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 05:51