>I've built a container class which has two labels in it.
>
>The container has code in several methods: RightClick, MouseDown, MouseUp, etc.
>
>My problem is that if I, for example, RightClick while the mouse is over one of the labels it fires the label's RightClick event. I've "solved" the problem by coding
>this.parent. < event >
>into the relevant events for each of the labels.
>
>There HAS to be a better way to do this. I suspect that it has to do with zOrder, but haven't yet found the right combination of properties to get it working properly.
>
To extend what Christian said, this is exactly the kind of situation that BindEvents() is intended for. What I've done is added properties to my base container class: lBindClick, lBindDblClick, etc. In the container's Init method, I check each property and, if it's .T., drill down binding every control inside the container to the container for the appropriate method.
Tamar