Create a fully transparent WPF window to capture mouse events

前端 未结 6 2143
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 08:30

I\'m trying to trap mouse events in WPF by using a topmost, transparent non-modal window. I\'m finding that this works fine if the opacity of the window is 0.01 or greater

6条回答
  •  情歌与酒
    2020-12-29 09:23

    Just set Background=Brushes.Transparent instead of Background=null.

    You don't need to use opacity at all (ie. just leave it at 100% opacity).

提交回复
热议问题