2

I build a WPF UserControl. This control has a transparent background. I want to trap the MouseLeftButtonDown event, even when this event happens on the transparent background. If I change the background to "White", or another color, the event is trapped as expected.

Is there a way to tell the control to listen for the event, even if it happens over a transparent area?

Thanks.

Sako73
  • 9,957
  • 13
  • 57
  • 75

1 Answers1

3

There is a difference in specifying no Background and specifying a transparent background: {x:Null} vs. Transparent?

Community
  • 1
  • 1
Emond
  • 50,210
  • 11
  • 84
  • 115
  • You're right. I was not specifying a background. When I specified Background="Transparent", it worked perfectly. Thank you. – Sako73 Apr 12 '11 at 14:11
  • You are welcome. If this is the answer please mark it as the answer so others can benefit. Thanks! – Emond Apr 12 '11 at 15:10
  • Sorry, I had clicked "Answer", but I guess it didn't get through. – Sako73 Apr 12 '11 at 16:30