Universal Windows Platform (UWP)
A Microsoft platform for building and publishing apps for Windows desktop devices.
3,019 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm trying to have a KeyDown
function that makes the focus move to the next control.
I've tried this but it throws me an error:
private void Obj_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (e.Key.ToString() == "Enter") FocusManager.TryMoveFocus(FocusNavigationDirection.Down);
}
Error:
System.Runtime.InteropServices.COMException: 'Catastrophic failure (0x8000FFFF (E_UNEXPECTED))'
Any hint on how can I make this work?
Thanks,
David
Check if a workaround works for you (https://github.com/microsoft/microsoft-ui-xaml/issues/5593):
. . .
var fneo = new FindNextElementOptions { SearchRoot = tb.XamlRoot.Content };
FocusManager.TryMoveFocus(FocusNavigationDirection.Next, fneo);
. . .
Use an appropriate control for tb.
I need application download