0

I'm making mouse listener in wpf, and I see that I need to use WH_MOUSE, but unfortunately it generates error (I don't have it). How Do I import it to my project?

Omikor
  • 5
  • 4

1 Answers1

0

Yes, the trick is to use Brushes.Transparent for the Background. By default, the Background is null, which lets you click through to the elements below. When you use Transparent instead, the background is still see-through, but it responds to input like mouse clicks.

<Rectangle x:Name="Rect" MouseLeftButtonDown="leftDown" Fill="Transparent" Width="100" Height="100"/>
Keith Stein
  • 6,235
  • 4
  • 17
  • 36