I’m trying to make a style for a listbox which will set the selected item to an item when the item has the mouse on it.
Any hints?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it using a style in the ListBox itself that affects all its items:
That’ll set the IsSelected property on the item to true when the IsMouseOver property is true. Provided your ListBox isn’t multi-select it works the way you’d expect.