Set the focus on a textbox in xaml wpf

后端 未结 9 1024
走了就别回头了
走了就别回头了 2020-11-30 00:29

Despite some posts on this forum and others i cannot find something that tells me how to set the focus on a TextBox.

I have a userControl with many labe

9条回答
  •  遥遥无期
    2020-11-30 01:00

    bind the element you want to point the focus in as

    FocusManager.FocusedElement= "{Binding ElementName= Comobox1}"
    

    in grid or groupbox etc

提交回复
热议问题