DataGrid - KeyPress event

J

john sutor

When moving up and down with the arrow keys on my DataGrid, I cannot get
either the Keypress, KeyUp or KeyDown events to respond. I am putting
breakpoints in to capture the event but they never get fired. Any input
will be helpful.

JOhn
 
C

Christina Androne

john said:
When moving up and down with the arrow keys on my DataGrid, I cannot
get either the Keypress, KeyUp or KeyDown events to respond. I am
putting breakpoints in to capture the event but they never get fired.
Any input will be helpful.

Does the selected index changed event fire?


Christina Androne
 
T

Tobin Harris

john sutor said:
When moving up and down with the arrow keys on my DataGrid, I cannot get
either the Keypress, KeyUp or KeyDown events to respond. I am putting
breakpoints in to capture the event but they never get fired. Any input
will be helpful.

Don't know about key events, but is the CellChanged event firing?

Tobin
 
D

David Sabo

Alright.....try this...
You should create a method than handle de keydown event. something like
this

Private Sub Move_Grid (ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles DataGrid.KeyDown

End Sub

There you should check if the key pressed is the one you want to react,
like this:

If e.KeyCode = Keys.PageDown then or something like this
[Code for scrolling down]
End if

well I hope this helps....

David Sabo
Caracas, Venezuela
 
R

Road Warrior

Ok this may sound a bit unorthodox but if you try it you will be amazed at
how good the results can be. First obtain a graphic of Michael Jordon that
shows him about to make a difficult shot. Note the position of his tongue as
he attempts the shot. Now here is the most important part.....as closely as
possible mimic this critical tongue position you retry the Keypress, KeyUp
or KeyDown events.

I love this game!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top