键盘焦点VS在WPF逻辑焦点 [英] Keyboard focus vs logical focus in WPF

查看:1453
本文介绍了键盘焦点VS在WPF逻辑焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过键盘焦点和逻辑焦点在WPF的区别是什么?如何WPF的重点是在winform的重点不同?

What is the difference by Keyboard focus and logical focus in WPF? and how WPF focus is different from the focus in winform ?

推荐答案

焦点概述

键盘焦点是指当前正在接收的元件   键盘输入。可以有整个桌面上只有一个元素   具有键盘焦点。在WPF中,具有键盘焦点的元素   将已IsKeyboardFocused设置为true。静态属性   FocusedElement在键盘类获取的元素,目前   具有键盘焦点。

Keyboard focus refers to the element that is currently receiving keyboard input. There can be only one element on the whole desktop that has keyboard focus. In WPF, the element that has keyboard focus will have IsKeyboardFocused set to true. The static property FocusedElement on the Keyboard class gets the element that currently has keyboard focus.

逻辑焦点指FocusManager.FocusedElement的焦点   范围。聚焦范围,保持轨道的元素   在其范围内FocusedElement。当键盘焦点离开焦点   范围,焦点元素会失去键盘焦点,但将保留   逻辑焦点。当键盘焦点返回到焦点范围,   焦点元素将获得键盘焦点。这允许键盘   重点多个重点领域之间进行切换,但保证   在焦点范围的焦点元素重新获得键盘焦点时,焦点   返回到焦点范围

Logical focus refers to the FocusManager.FocusedElement in a focus scope. A focus scope is an element that keeps track of the FocusedElement within its scope. When keyboard focus leaves a focus scope, the focused element will lose keyboard focus but will retain logical focus. When keyboard focus returns to the focus scope, the focused element will obtain keyboard focus. This allows for keyboard focus to be changed between multiple focus scopes but ensures that the focused element in the focus scope regains keyboard focus when focus returns to the focus scope.

这篇关于键盘焦点VS在WPF逻辑焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆