Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Private Sub DataGridView1_mt_KeyDown(sender As Object, e As KeyEventArgs) Handles DataGridView1_mt.KeyDown
  2.  
  3. If e.KeyCode = Keys.Enter Then
  4. ...
  5.  
  6. Private Sub DataGridView1_EditingControlShowing(sender As System.Object, e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1_mt.EditingControlShowing
  7.  
  8. Dim tb As TextBox = CType(e.Control, TextBox)
  9. AddHandler tb.KeyDown, AddressOf TextBox_KeyDown
  10.  
  11. End Sub
  12.  
  13. Private Sub TextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
  14. If e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Return Then
  15.  
  16. MessageBox.Show("Success") '''''DOES NOT WORK
  17. End If
  18. If e.KeyCode = Keys.Space Then
  19.  
  20. MessageBox.Show("Success") '''''WORKS
  21. End If
  22. End Sub
  23.  
  24. If e.KeyCode = Keys.Down Then
  25. 'code
  26. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement