Moving cursor/mouse out of the listBox caused highlighted item color change in WPF RRS feed

  • Question

  • Hi, we have listBox in the GUI and if we click an item, it's highlighted with blue color, but if we move the mouse/cursor outside of the listBox area, the highligt color disappear and turn to outlined (maybe default system highlight from what read somewhere).

    Does anyone know how to fix this?

    Thanks in advance!

    Wednesday, January 29, 2020 1:00 AM

All replies

  • Could be the XAML, could be the code behind could be a combination of both so that leads to you providing more details.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Wednesday, January 29, 2020 3:28 AM
  • Hi,

    Have you changed the listbox template?


     <Style  TargetType="ListBoxItem">
                <Setter Property="Template">
                        <ControlTemplate TargetType="ListBoxItem">
                            <Border Name="Border1">
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="Border1" Property="Background" Value="Yellow"/>

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, January 29, 2020 6:30 AM