0

in a Windows Forms Application, I have a PictureBox around the Cursor (using the MouseMove-Event), but want to pass the Click Event on to the Controls below it. At the moment the PictureBox Click-Event fatches every Click. Therefore I think I have to make this one PictureBox some kind of invisible for the Click Event.

How do I have to change the PictureBox Click-Event in order to do so?

Thanks in advance! Toby

LarsTech
  • 80,625
  • 14
  • 153
  • 225
Toby
  • 9
  • 2
  • Describe your scenario better, which is the container and which is the content. – csharpwinphonexaml Nov 05 '15 at 19:06
  • There is a PictureBox with its center at the Mouse Position. Moving around with the Mouse Movement (MouseMove-Event). And on my Form are a couple of other PictureBoxes on which I can click. But the one PictureBox at my Cursor always gets the Click-Events instead of the ones on the form. – Toby Nov 05 '15 at 19:09
  • I don't see how i could possibly use the code given in the answer there to solve my problem – Toby Nov 05 '15 at 19:23
  • Why does that accepted answer not work for you? Did you try it? – LarsTech Nov 05 '15 at 19:53
  • I literally have no idea how i could try that. Where would i put that function and how do i use it? – Toby Nov 05 '15 at 19:56
  • You are only looking at the code, not the answer: `create a control inherited from Label and simply add the following code` Change Label to PictureBox and use that new control in place of the PictureBox you are currently using. – LarsTech Nov 05 '15 at 20:07
  • Would you mind giving me an example of how to create that PictureBox? – Toby Nov 05 '15 at 20:11
  • @Toby, create a class that inherits from PictureBox. There are lots of examples of how to create a class on the Internet. –  Nov 05 '15 at 20:12
  • Thanks Amy. But it doesn't work for me as I first have to be able to click on the PictureBox in order to make it follow the cursor... – Toby Nov 05 '15 at 20:54
  • You want a control that you can click on and not click on? That's quite a moving target you got there. Maybe you should share your code in order for this question to get re-opened and for you to get some help on this topic. – LarsTech Nov 05 '15 at 21:58

0 Answers0