2

我正在这个应用程序中处理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);
 }

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

4

1 回答 1

1

我还没有使用 Windows 8 Metro,但您可以尝试添加以下内容:

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

这应该停止对鼠标悬停和诸如此类的任何可视化,但这是一个 WPF 答案,它应该适用于 Metro,但没有承诺!

于 2012-06-05T12:06:22.147 回答