I have a list, and when I click on an element, it raises the SelectedIndexChange event, in this case I want to set focus on the text field, so I call:
this.ActiveControl = theTextBoxControl;
I see the focus switch in the text box for a second, but the focus returns to the list as soon as the event ends. Any ideas how to fix this?
you could create and set a flag to true, for example needToFocusTextBox. And then do the following in the onFocus event in the ListView.
needToFocusTextBox
if (needToFocusTextBox) this.ActiveControl = theTextBoxControl;
onFocus SlectedIndexChange. , onfocus