Search code examples
c#winformsfocuswindows-ce

Focus set automatically on Winform


I have a form which contains some textBoxes. I have configured the textBox's GotFocus and LostFocus events.

My problem is: When some textBox loses focus, the form automatically set the focus on the first textBox and it triggers the GotFocus event again.

How do I not set the focus by default?


Solution

  • Check the tabindex of the text boxex from where focus is transferred to first text box. I think the TabStop property is set to false for the textboxes for some of the controls.