Hello, I want move the focus between controls with enter key, like (TAB).
Can you help me?
Thanks.
Antoni Gomez
HI,
Here is the step..
1. set winforms KeyPreview to True
2. On the key_down event add the following code..
if (e.KeyValue == 13) SendKeys.Send("{Tab}");
Is this is what you wanted..??
Vinu
> Hello, I want move the focus between controls with enter key, like (TAB).
>
[quoted text clipped - 3 lines]
>
> Antoni Gomez
Michael Powell - 27 Feb 2006 14:01 GMT
Hi,
This is a bit of a cheat method, and it will remove the possibility for
using the enter key, you should override ProcessCmdKey to process various
command keys as follows, to do this you must base your class on Control:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(keyData==(Keys.Enter))
{
//change the focus
}
return true;
}

Signature
Mike Powell
Ramuseco Limited
www.ramuseco.com
> HI,
>
[quoted text clipped - 15 lines]
>>
>> Antoni Gomez
Thanks for your help.
The code works fine.
Antoni Gomez
> Hello, I want move the focus between controls with enter key, like (TAB).
>
[quoted text clipped - 3 lines]
>
> Antoni Gomez