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
인 경우
예제
다음 예제에서는 를 사용하여 논리 포커스가 있는 요소를 설정하고 를 사용하여 SetFocusedElementGetFocusedElement논리적 포커스가 있는 요소를 가져옵니다.
// 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 특정 포커스 scope 대한 논리적 포커스가 있는 요소입니다. 포커스 scope 요소가 로 설정true
되었습니다IsFocusScope.
이 개체에는 키보드 포커스가 있거나 없을 수 있습니다. 키보드 포커스는 키보드 입력을 수신하는 요소를 나타냅니다. 포커스, 키보드 포커스 및 논리적 포커스에 대한 자세한 내용은 입력 개요를 참조하세요.
가 포커스 scope 아닌 경우 element
이 메서드는 를 반환null
합니다.
를 사용하여 SetFocusedElement지정된 포커스 scope 내에서 논리적 포커스가 있는 요소를 지정합니다.
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기