WPF Window set Focus

后端 未结 2 561
-上瘾入骨i
-上瘾入骨i 2021-01-02 05:59

I have a WPF Window which I only create one time and then Show() and Hide() several times. Now I am searching a way to set the focus on a element on each Show(). Where and h

2条回答
  •  时光取名叫无心
    2021-01-02 06:59

    Just call Element.Focus() on the element you want to focus.

    If you mean bring focus to the window try calling window.Activate()

提交回复
热议问题