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

标签 c# xaml windows-8

我正在开发此应用程序中的 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,但您可以尝试添加以下内容:

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

这应该停止鼠标悬停等的任何可视化,但这是 WPF 的答案,它应该与 Metro 一起工作,但没有 promise !

关于c# - 在 Windows 8 Metro 应用程序中禁用鼠标悬停焦点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10896955/

相关文章:

xaml - 为什么 TextBlock 会修剪文本中的结尾空格?

c# - 红隼: get access to IP+port pair(s) it's listening on

c# - 如何使用c#中的程序检查堆栈内存的大小

c# - 使用 JArray 从 JSON 中获取值

.net - 如何使元素能够在其容器外绘制?

c# - WPF 控件和边距与窗口大小成比例

c# - MonoGame 按键字符串

xaml - 如何在 Xamarin Forms 中显示 ToolBarItem 图标的徽章计数

cookies - 通过 Win Store 应用程序的代码为 webview 设置 cookie/ header

java - 解析 Android L 的数据失败。不支持的 major.minor 版本 51.0