Profile Picture

Getting keyboard input when a button is clicked

Posted By Jobelle Firme 4 Years Ago
Author
Message
Jobelle Firme
Question Posted 4 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 4 Years Ago
Posts: 8, Visits: 65
Hi,

I was wondering if there is a way to get keyeventargs when a button is clicked? To be specific, I wanted to know if the Shift key was pressed when the Delete button was clicked.

I currently have:

AddHandler RibbonButtonDelete.Click, AddressOf ButtonDeleteFile_Click
Private Sub ButtonDeleteFile_Click(ByVal e As NEventArgs)
   'code here
 End Sub


Thank you.

Tags
Nevron Support
Posted 4 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 Weeks Ago
Posts: 3,054, Visits: 4,015
Hi,

You can use the NKeyboard.ShiftPressed property to check if the Shift key is pressed. For example:


Private Sub Button_Click(ByVal e As NEventArgs)
  If (NKeyboard.ShiftPressed) Then
   MessageBox.Show("Shift pressed!")
  End If
End Sub



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic