WPF: PopUp on MouseOver of a ComboBoxItem

微笑、不失礼 提交于 2019-12-01 14:24:21

Before we start, could you just use a tooltip?

otherwise, style the ComboBoxItem's control telmplate, include your popup in the style positioned where you want but set the Isopen property to false.

Use a trigger on mouse over to set your popup's IsOpen property to true.

here is an example of using a trigger OnMouseOver

you will end up with a trigger in your style like this :-

  <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
      <Setter TargetName="thePopupsName"
              Property="IsOpen"
              Value="True" />
    </Trigger>
  </Style.Triggers>

when the mouseOver occurs the popup will popup, when its gone the popup will return to its default value.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!