T
Tony Lin
I have written a custom Windows control from scratch, deriving from the Windows.Forms.Control class.
My control has a text input area, capable of receiving focus. It has a KeyDown event handler, which handles Keys.Left, Keys.Right, Keys.Home, Keys.End.
When focus is on my custom control, pressing Left Arrow or Right Arrow shifts focus to the previous or the next control, rather than raising a KeyDown event in my custom control. The result is that my custom control never sees a KeyDown event with a KeyCode of Keys.Left or Keys.Right.
My custom control handles Keys.Home and Key.End just fine.
Does anyone know what I have to do, to have focus remain in my custom control when LeftArrow or RightArrow is pressed, so that my control handle that event?
Tony Lin
Fremont, CA
My control has a text input area, capable of receiving focus. It has a KeyDown event handler, which handles Keys.Left, Keys.Right, Keys.Home, Keys.End.
When focus is on my custom control, pressing Left Arrow or Right Arrow shifts focus to the previous or the next control, rather than raising a KeyDown event in my custom control. The result is that my custom control never sees a KeyDown event with a KeyCode of Keys.Left or Keys.Right.
My custom control handles Keys.Home and Key.End just fine.
Does anyone know what I have to do, to have focus remain in my custom control when LeftArrow or RightArrow is pressed, so that my control handle that event?
Tony Lin
Fremont, CA