Click through a canvas

I have overlaid a canvas on top of a window with controls on it. I can still click buttons through the canvas, I was not aware this was possible, is this correct?

my understanding is mouse events start at the top of the z-order and work down until something dispatches the event

But if I return true in the canvas mousedown event it should not cascade down should it?

that is what I would expect… assuming the z-order of the canvas is higher

I don’t think z-order is configurable is it. But the canvas is visually foremost, I return true in mousedown but still the button behind it fires.

Mike I had an issue similar to this with 2 listboxes. I needed a multi column drop menu with images, so I used a listbox & canvas for the custom control. The problem I had was when I displayed the menu listbox over the window listbox, the window listbox header would display through the menu listbox. My solution was to disable the window listbox when I displayed the menu listbox.

This may not fit in your case, but can you disable the button before showing the canvas?

[quote=148083:@Johnny Harris]Mike I had an issue similar to this with 2 listboxes. I needed a multi column drop menu with images, so I used a listbox & canvas for the custom control. The problem I had was when I displayed the menu listbox over the window listbox, the window listbox header would display through the menu listbox. My solution was to disable the window listbox when I displayed the menu listbox.

This may not fit in your case, but can you disable the button before showing the canvas?[/quote]

Yes I could but didn’t want to through laziness. There are quite a few controls behind the canvas. In fact the canvas covers the whole window so there are all the controls on the window to disable and then re-enable.

Yes it is. You can set a control on top of another.

I have placed a canvas over a button and returned true in the MouseDown event, the button cannot be clicked anymore.

Mac+Yosemite.