I have tabControl in the form. In one of the tabItems I have textbox(myTextBox). Let's call it tabItem1. When I write something into the this text box placed in the tabItem1 I want to focus textbox(searchTextBox) in the tabItem2. I placed this code in the KeyDown of the
tabItem2.Focus();
searchTextBox.Text = searchTextBoxTeropatik.Text;
searchTextBox.Focus();
I wrote this small function for this purpose. But there is a big problem.
I press the Key
tabItem2 gets the focus.
But searchTextBox does not get the focus.(My problem)
Call
UpdateLayout()
after focusing the secondTabItem
so the system gets the time to redraw the tab.