In ListBoxmy Ten Point paragraph application, the user can see five elements at a time. Sometimes I select elements from the code and focus settings.
Element selection and focusing work fine when elements are visible on Form, but for other invisible elements I cannot set focus (NOTE: after selection, it is visible to the user).
Can anybody help me?
var item = _listView.ItemContainerGenerator.ContainerFromIndex(index) as ListBoxItem;
if (item != null)
{
item.Focus();
}
source
share