1

I need to create a picturebox on top of a textbox, that when clicked, passes the click onto the picturebox below the textbox. How would I go about doing this? Would I use SendMessage to, somehow, send the click down to the textbox and cancel it on the textbox? If so, what messages would I send?

The picturebox, in Z-order, is above the textbox. However, any event of clicking should be passed as if the textbox was above the picturebox.

brianush1
  • 199
  • 1
  • 13
  • *"Below"*, *"on top"*. I'm confused. Are you talking about Z-order? And which one is on top of which control? – IInspectable May 26 '15 at 22:25
  • There is a picturebox on top of a textbox. I want that when you click on the picturebox, even though it will seem it's on top of the textbox, click on the textbox. Basically, like the pointer-events: none; tag in CSS that makes mouse events go right under the control. – brianush1 May 26 '15 at 22:27
  • Please update the parts in your question that contradict each other. You still need to answer the question, whether you are talking about Z-order, or another geometric relation. – IInspectable May 26 '15 at 22:30

1 Answers1

1

If you don't want a window to receive input you have to disable it, calling the EnableWindow function:

Enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses.

Mouse messages go to the topmost window underneath a disabled window.

IInspectable
  • 46,945
  • 8
  • 85
  • 181
  • I didn't say anything about a disabled window, however, I will try that with a control and hope it works. – brianush1 May 26 '15 at 22:51