在 Windows 8 Metro 应用程序中禁用鼠标悬停焦点

本文关键字:鼠标 悬停 焦点 Windows Metro 应用程序 | 更新日期: 2023-09-27 18:36:25

我正在此应用程序中处理 window8 metro 应用程序,我正在插入两个图像按钮,在模拟器中我是鼠标模式指针输入这次获得焦点。

我正在实现此代码...

 private void button_PointerEntered(object sender, Windows.UI.Xaml.Input.PointerEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("Pointer Entered");
     Button thisButton = (Button)sender;
     thisButton.Focus(FocusState.Unfocused);
 }

如何禁用鼠标指针上的焦点?

在 Windows 8 Metro 应用程序中禁用鼠标悬停焦点

我还没有使用Windows 8 Metro,但你可以尝试添加这个:

<Setter Property="FocusVisualStyle" Value="{x:Null}" />

这应该停止鼠标悬停等的任何可视化,但这是一个 WPF 答案,它应该适用于 metro,但没有承诺!