• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

Shift + Alt + Ctrl Keypress

I'm using this ProcessDialogKey to monitor key presses.
When any key is pressed, except the Ctrl key combination the test msgbox must be displayed.
I other word, if the user presses Ctrl+A, Ctrl+C or any other Ctrl key combination the msgbox must not appear.


  Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean
    Try
      If Not (keyData = Keys.ControlKey) Then
        MsgBox("test")
      End If
    Catch ex As Exception
      MsgBox(ex.Message)
    End Try
  End Function

Open in new window

0
koossa
Asked:
koossa
1 Solution
 
CodeCruiserCommented:
0
 
Pratima PharandeCommented:
try this

Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean
        Try

            If Not (Convert.ToInt32(keyData) = 131089) Then
                MsgBox("test")
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Function
0
 
koossaAuthor Commented:
Thank you the Control.ModifierKeys <> Keys.Control is working!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now