I have a weird situation. I have a panel with 4 textboxes, 2 are read only. I have tab stop set to true and tab index set on panel and two editable textboxes. When running the application, the first textbox never receives focus. I have deleted the textbox and created a new one with a different name, same result. I then reversed the tab order and the other textbox was skipped. for some reason, whichever textbox is set to be hit first when the panel receives focus is completely ignored. I have tried manually setting the tab order and using the tab order wizard both. I have even tried to programmatically set tab index and tab stop just to make sure without any luck. I have several other panels and group boxes on the same form with similar controls, and they all work as expected. I'm running out of ideas, does anyone have any suggestions?
Asked
Active
Viewed 640 times
0
-
Are you able to use `textBox1.Focus()` or `textBox1.Select()` in the `Form_Load` event? – TEK Apr 25 '16 at 21:13
-
Negative. I tried both focus and select and it jumps to textBox2. – Chris Apr 25 '16 at 21:20
-
Correction: I can use both focus and select. But the textbox is in the middle of the form, I need it to be in the tab index correctly instead of manually setting it to be the first control the user gets to. – Chris Apr 25 '16 at 21:28
-
Why do you have a tab index on the panel? – Dmitry K. Apr 25 '16 at 23:53
-
No other code besides the tabindex is changing the focus of the textboxes? are you handling something like GotFocus or LostFocus events in the panel or its children? Are you using `SendKeys("{Tab}")` in some place? – LoRdPMN Apr 26 '16 at 22:41