I have a windows application containg diffrent controls like label,textbox,button..
And I need to select next Control when tab is pressed.
I am able to catch tab pressed event as:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Tab)
{
}
return base.ProcessCmdKey(ref msg, keyData);
}
How shouid I procced further?
This is handled for you automatically by the OS and you shouldn’t interfere with it without a really good reason.
You can adjust the order of which control [Tab] goes to next by setting the
TabIndexproperty for the controls that you are using.