MouseOver highlighting style returning to default after a second (Caused by Aero?)

后端 未结 2 450
刺人心
刺人心 2020-12-22 03:38

I\'d trying to style my ComboBoxes to match the rest of the UI but I\'m having problems with the IsMouseOver highlighting. It highlights with the color I specify for a secon

2条回答
  •  佛祖请我去吃肉
    2020-12-22 04:08

    The problem is indeed due to the default template for the ComboBox. If you use Reflector to open the PresentationFramework.Aero assembly you can take a look at the ButtonChrome class. There is a method called OnRenderMouseOverChanged that is hiding the Red background.

    Even though it is a lot of work, for ComboBox at least, you probably will want to override the default template for the ComboBox. You can get the basic idea of what the ComboBox temlpate is like by using Show Me The Template or Blend.

    You can use your same style to override the template.

    
    

提交回复
热议问题