Hi,
I am a little bit confused about focus handling in a UserControl.
I have a UserControl with TabStop set to true and a TextBox in a form. Whenever I press the tab-key the focus changes as it should.
But as soon as I add a TextBox inside the UserControl, the UserControl does not get the focus anymore.
What I want:
Focus on single TextBox. Press Tab to set focus to UserControl itself. Press Tab to move to the TextBox which is a child of the UserControl. Press Tab to move to external TextBox.
What I get: Focus in son single TextBox. Pressing Tab moves the focus to the UserControl's child TextBox. Pressing Tab moves the focus to the external/single TextBox again.
Why isn't it possible to set the focus to the UserControl itself, when it has child elements that can receive the focus?
I want to program a UserControl with two elements. One area (I used a Panel as base control for this) where I want to build up the complete desired functionality on my own and one area for standard text input (=standart TextBox). Now I want that the focussteps through every element of my UserControl when the user hits the tab key. I already set the TabStop property of the UserControl and Panel to true. But as mentioned above, as soon as I add the TextBox, the parent UserControl does not receive the focus anymore.
I guess if I would choose TextBox as baseclass instead of Panel everything might work. But I want a baseclass with an absolute minimum of functionality.
Br,
Wannabe