Hello,
I have a datagrid and I would that if I press an arrow key (up and down) the
cursor don't move up and down on the datagrid.
There is a solution for my problem?
I have used keypress and keyup but don't capture the arrow keys.
Only KeyDown capture ArrowUp and ArrowDown but e.Handler = True don't avoid
the event "press arrow key" and the cursor move in the datagrid.

Thank you
Marco

Re: Disable ArrowKey by Dmytro

Dmytro
Thu Apr 06 05:11:45 CDT 2006

Hello,

In a DataGrid, tapping into keystroke processing is much more complicated.
You will have to override a number of methods, each of them being called
under different circumstances:

ProcessCmdKey - to handle Alt-<Down Arrow>, Alt-Del, Gray + / Gray -
PreProcessMessage - to handle Del
ProcessKeyPreview - to handle +, -, Enter, Arrows and Tab, PgUp, PgDn, also
Esc
ProcessDialogKey - to handle +, -, Enter, Arrows and Tab, PgUp, PgDn, also
Esc (but this one is invoked under different circumstances)

The above assumes .NET 1.1

"Marco" <Marco@discussions.microsoft.com> wrote in message
news:A30E4658-5C5D-4742-BA77-4C11EBC37CA3@microsoft.com...
> Hello,
> I have a datagrid and I would that if I press an arrow key (up and down)
> the
> cursor don't move up and down on the datagrid.
> There is a solution for my problem?
> I have used keypress and keyup but don't capture the arrow keys.
> Only KeyDown capture ArrowUp and ArrowDown but e.Handler = True don't
> avoid
> the event "press arrow key" and the cursor move in the datagrid.
>
> Thank you
> Marco


Re: Disable ArrowKey by Marco

Marco
Fri Apr 07 03:36:02 CDT 2006

Thank you very much

Marco