I'm using OwnerDrawFixed
as a DrawMode for the custom ListBox control in my WinForms app.
I want to repaint the background (or do some other action) of the ListBoxItem when the user hovers over the listbox item, that is, at the MouseMove…
DrawItemState.HotLight
never works for the ListBox, so i wonder how to emulate it, how to workaround this problem.
Best Answer
It took me only two years to find the answer for you, but here it is:
The DrawItemState.HotLight only applies to owner drawn menus, not the listbox. For the ListBox, you have to keep track of the item yourself: