none
ListBox loses focus when listboxitem is clicked RRS feed

  • Question

  • I have several listboxes on a windows form and I want to change the border colour to indicate which list has focus. In the form loaded event I set the focus to the first list and the border colour is displayed differently to the others just as I want it. However, when I click on an item in the listbox the border colour reverts back to the default colour. How can I stop this?
    Thursday, April 9, 2009 12:40 PM

Answers

  • I changed the setter property from IsFocused to IsKeyboardFocusWithin and that fixed it.
    • Marked as answer by SRichardson Thursday, April 9, 2009 12:53 PM
    Thursday, April 9, 2009 12:53 PM