WPF MoveFocus () works on Vista, not XP
The next bit of code works on Vista as expected (focus moves down the list), but on XP SP3 (with .Net 3.5 SP1 on both) it only moves between the first two ListView items.
if (myListView.SelectedItem != null) {
IInputElement orig = FocusManager.GetFocusedElement(this);
FocusManager.SetFocusedElement(this, myListView);
ListViewItem lvi = myListView.ItemContainerGenerator.ContainerFromItem(myListView.SelectedItem) as ListViewItem;
TraversalRequest down = new TraversalRequest(FocusNavigationDirection.Down);
Boolean result = lvi.MoveFocus(down);
Console.WriteLine(result.ToString());
FocusManager.SetFocusedElement(this, orig);
}
I am calling this code from the event preview window when the focus is on the textbox. I'm diving into the box right now to try and find what's different between XP and Vista inside MoveFocus (). I feel like I'm doing web development again, testing browsers for quirks ...
source to share
My overall feeling is that many of the features in WPF use technology that is new in Vista and not supported in XP. The things I've experienced are mostly related to visuals, but in your case, this is obviously something else.
My initial thought in your case is that there are new Windows messages in Vista that don't work in XP.
source to share