Andrew Arnott

News from my corner of the Visual Studio Connected Experience team, programming tips, and solutions to common programming issues.

How to find the focused ListBoxItem in WPF

One would expect that the WPF ListBox control would have some kind of FocusedIndex property to find out which item has the keyboard focus (and that dashed border around it) — but it’s not there.  It seems the workaround requires a few lines of code, which I present here. ListBox.SelectionMode = Single In a ListBox’s default… Read more