Set Item Focus in ListView WPF

后端 未结 5 1839
轻奢々
轻奢々 2020-11-29 10:45

is there any way to accomplish this functionality from WinForms in WPF?

ListView.FocusedItem = ListView.Items[itemToFocusIndex]

I\'m trying

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 11:18

    ListView items are UIElements, so simply use UIElement.Focus(). e.g., listViewItem.Focus() or button.Focus() and so on.

提交回复
热议问题