Strange problem with IsMouseOver on button in ListBoxItem?

Just a thought - try setting the SnapsToDevicePixels property on your listbox item template to "true". Might also be worth setting it on the button style.

Up vote 0 down vote favorite share g+ share fb share tw.

I have a template for my list box item. It includes an image button. The button changes images when you hover.

The problem I'm having is it's adding a weird artifact to the button when I hover. This ONLY happens though if it's in a ListBoxItem. If I put the button on the main canvas, it works fine.

Here is the image in the normal state: Here is the image in the hover state: Notice the 2 white lines on the top and right edges. What's even more strange, is when you move the mouse off, and it reverts the image, the artifact stays: Here is the code for my button. I've tried playing with every background brush (both the button, the listbox item, etc.) My listbox item template: wpf xaml mouseevent listboxitem link|improve this question edited Sep 12 '11 at 17:03Dave Clemmer1,77331030 asked Jan 6 '10 at 17:16mfanto2,2381311 88% accept rate.

It ended up being multiple styles for different elements conflicting. I'm not sure what the actual fix was. I just simplified all the styles and re-created some of the controls, and it went away.

Unfortunately I can't add any more beyond that, since I'm not sure what ultimately fixed it.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions