I have two controls partly or maybe full overlapping (see examples). I do not want the listbox to receive mouseDown, mouseMove
ect. events which is triggered from the orange control. Is this possible ? I have clue how can I do this.
Dont overlap controls… you can end up in a ‘Paint event horizon’ where one control causes a paint on another and vice versa.
But to answer your question: return TRUE in the mousedown event of the orange control and it shouldnt bleed through to the listbox.
In my test on Windows, return true in Mousedown event doesn’t work well. If i move the mouse over the orange square to the place where beneath it is the scrollbar from the listbox, the scrollbar pops up covering part of the orange square.
In Windows I would warn against stacking controls anyway because it promotes flicker. Plus indeed some control show through. Most notoriously TextField which pop up through anything covering them as soon as the mouse passes over.
To obtain the same effect as what the OP picture shows, I would instead use a canvas in which the Listbox is Drawinto, then made invisible. Then the orange area would be drawn over. The button would be made child of the Canvas, so it becomes invisible/visible when the canvas does.