Keyboard.FocusedElement 속성

정의

키보드 포커스가 있는 요소를 가져옵니다.

public:
 static property System::Windows::IInputElement ^ FocusedElement { System::Windows::IInputElement ^ get(); };
public static System.Windows.IInputElement FocusedElement { get; }
static member FocusedElement : System.Windows.IInputElement
Public Shared ReadOnly Property FocusedElement As IInputElement

속성 값

포커스가 있는 요소입니다.

예제

다음 예제에서는 키보드 포커스가 있는 요소를 가져오고 으로 캐스팅합니다 Control. 키보드 포커스가 있는 요소가 있으면 Control요소의 배경이 변경됩니다.

// Gets the element with keyboard focus.
UIElement elementWithFocus = Keyboard.FocusedElement as UIElement;
' Gets the element with keyboard focus.
Dim elementWithFocus As UIElement = TryCast(Keyboard.FocusedElement, UIElement)

설명

키보드 포커스는 키보드 입력을 수신하는 개체를 나타냅니다. 키보드 포커스가 있는 요소가 .로 IsKeyboardFocused설정되었습니다true. 전체 바탕 화면에 키보드 포커스가 있는 요소는 하나만 있을 수 있습니다. 논리적 포커스는 포커스가 있는 포커스 범위 내의 개체를 나타냅니다. 포커스, 키보드 포커스 및 논리적 포커스에 대한 자세한 내용은 입력 개요포커스 개요를 참조하세요.

키보드 포커스가 있는 요소에는 요소가 속한 포커스 범위에 대한 논리적 포커스도 있습니다. 논리적 포커스가 있는 요소에는 키보드 포커스가 있거나 없을 수 있습니다.

적용 대상