Thanks. That is precisely what I am trying to achieve. I want the user to be
control, up arrow to go to the one above and so on. I will try to make use
event.
"Chris Taylor" <chris_taylor_za@hotmail.com> wrote in message
news:C7BC057A-5D51-40FA-A216-F16A0659490A@microsoft.com...
> Hi,
>
> Maybe you can explain what it is that you what to achieve, are you trying
> to control the navigation programatically? If so then you should be
> looking at the ProcessDialogChar/ProcessDialogKey virtual functions.
>
> --
> Chris Taylor
>
http://dotnetjunkies.com/weblog/chris.taylor >
>
> "Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote in message
> news:OBFJP9KdHHA.1244@TK2MSFTNGP04.phx.gbl...
>> That's better but it still isn't working. The system is still getting in
>> and overriding my own set focus commands.
>>
>> An arrow key is being handled in a manner much like it would with an
>> array of radio buttons within a group. Up and left arrows go to the
>> previous control in the Z order. Down and right shift focus to the
>> control next in the Z order despite the fact that the program is setting
>> the TabStop property of the windows to false.
>>
>> The PreviewKeyDown event is, indeed, fired on key although the IsInputKey
>> is false, not true for cursor keys so I can now detect the user's cursor
>> keys. I then set the focus to the appropriate control but the system then
>> immediately turns around and sets it to the control it wants to. How can
>> I stop the system from setting focus?
>>
>> --
>> Richard Lewis Haggard
>>
www.Haggard-And-Associates.com >>
>> "Chris Taylor" <chris_taylor_za@hotmail.com> wrote in message
>> news:BF803EAA-C550-42D2-B50C-D38EC6821161@microsoft.com...
>>> Hi,
>>>
>>> Controls assume that the arrow are used to navigate between controls. By
>>> handling the PreviewKeyDown event and setting the
>>> PreviewKeyDownEventArgs.IsInputKey to true when the
>>> PreviewKeyDownEventArgs.KeyCode is one of the arrow keys you are
>>> interested in, allows the message to be handled by the KeyDown/KeyUp
>>> events.
>>>
>>> Hope this helps
>>>
>>> --
>>> Chris Taylor
>>>
http://dotnetjunkies.com/weblog/chris.taylor >>>
>>>
>>> "Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote in message
>>> news:uJKP75$cHHA.5044@TK2MSFTNGP05.phx.gbl...
>>>>I have a user control for which I'm trying to intercept arrow keys. I've
>>>>subscribed to both the KeyDown and KeyPress events. Normal keys are
>>>>delivered through the KeyPress event handler but arrow keys are not
>>>>delivered here. They do arrive at the KeyDown event but only if the
>>>>control key is also down. What am I doing wrong?
>>>> --
>>>> Richard Lewis Haggard
>>>>
www.Haggard-And-Associates.com >>>>
>>>
>>
>>
>