FocusManager.GetFocusedElement(DependencyObject) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 포커스 범위 내에서 논리적 포커스가 있는 요소를 가져옵니다.
public:
static System::Windows::IInputElement ^ GetFocusedElement(System::Windows::DependencyObject ^ element);
public static System.Windows.IInputElement GetFocusedElement(System.Windows.DependencyObject element);
static member GetFocusedElement : System.Windows.DependencyObject -> System.Windows.IInputElement
Public Shared Function GetFocusedElement (element As DependencyObject) As IInputElement
매개 변수
- element
- DependencyObject
포커스 범위인 요소입니다.
반품
논리적 포커스가 있는 지정된 포커스 범위의 요소입니다.
예외
element은 null입니다.
예제
다음 예제에서는 요소를 사용하여 SetFocusedElement 논리적 포커스가 있는 요소를 설정하고 해당 요소를 사용하여 GetFocusedElement논리적 포커스가 있는 요소를 가져옵니다.
// Sets the focused element in focusScope1
// focusScope1 is a StackPanel.
FocusManager.SetFocusedElement(focusScope1, button2);
// Gets the focused element for focusScope 1
IInputElement focusedElement = FocusManager.GetFocusedElement(focusScope1);
' Sets the focused element in focusScope1
' focusScope1 is a StackPanel.
FocusManager.SetFocusedElement(focusScope1, button2)
' Gets the focused element for focusScope 1
Dim focusedElement As IInputElement = FocusManager.GetFocusedElement(focusScope1)
설명
특정 FocusedElement 포커스 범위에 대한 논리적 포커스가 있는 요소입니다. 포커스 범위인 요소가 .로 true설정되었습니다IsFocusScope.
이 개체에는 키보드 포커스가 있을 수도 있고 없을 수도 있습니다. 키보드 포커스는 키보드 입력을 수신하는 요소를 나타냅니다. 포커스, 키보드 포커스 및 논리적 포커스에 대한 자세한 내용은 입력 개요를 참조하세요.
element 포커스 범위가 아니면 이 메서드가 반환null됩니다.
를 사용하여 SetFocusedElement지정된 포커스 범위 내에서 논리적 포커스가 있는 요소를 지정합니다.