Quantcast
Viewing all articles
Browse latest Browse all 12583

Listbox hover states in an ElementHost

Hey all, I hope this is a quick question for someone.

I have an ElementHost control on my Windows Forms form. The host is used for various reasons, but primarily for providing a nice UI for a long running process. A user types text into a textbox and the text changed handler starts off some background work. While the work is happening, a progress bar is displayed in the ElementHost, and once done, a WPF listbox is instead shown (with the progress bar being hidden). Basically a custom combo box.

If I click in the listbox (i.e. select an item) I get all of my lovely hover states, however none of the hover states for the items are there otherwise.

So the question is: is there a way to enable the hover states of the list box without having to have clicked in the control? I have attempted to set the focus on the control (with listbox.Focus()) but that doesn't work. I assume it's something to do with hosting the control in an ElementHost.

Any help appreciated.

Cheers


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>