I have this code:
this.searchInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.inputKeypress);
private void Keypress(object sender, KeyPressEventArgs e)
{
// If Tab has been pressed
if(122 == (int)e.KeyChar)
{
switchTab(sTab);
MessageBox.Show(sTab);
}
}
What it does is that it sets focus to another element. But, when the focus is set to a TextBox, and I press TAB, it just makes a tab in the TextBox, and does not set focus on the next element.
Anyone got an idea how can I make this work?
I've tried to set e.Handled = true; but that didn't work...