WPF equivalent to ActiveControl?

In Forms, I can simply use ActiveControl.name to get the name of the active control. However, this does not work in WPF. What is a WPF command equivalent to Activecontrol.name? I will take C # or VB, anyway. Thank!

+3
source share
1 answer

There are several possibilities, although I'm not sure if this is an exact match for ActiveControl:

  • Keyboard.FocusedElement: This static member tells you which element has keyboard focus in the current application.
  • FocusManager.GetFocusedElement(): . , , , (.. FocusManager.IsFocusScope true).

, ?

+2

Source: https://habr.com/ru/post/1730494/


All Articles