Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Container Click and Contained Button Click
Message
 
To
08/06/2001 08:31:22
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00516821
Message ID:
00516843
Views:
9
This message has been marked as the solution to the initial question of the thread.
>I added some wait windows to some of the methods of objects to learn when what fires. I found that that the click of a button contained in a container fired, but the click of the container itself did not. Is it like a class where the child code overrides the class code by default? Just curious... Thanks!
>
>Regards, Renoir

Hi Renoir,

That's the default behavour. Click fires only for the clicked control because you may want different functionality for control click and parent container click. No, it is not like a an object where the instance method code overrides the parent class code. These are two separate objects, even if one contains another.

Also, Click event fires in other situations without actual mouse click, for example if you had the focus on the commandbutton and pressed spacebar, or Enter, or ESC (if the button.Cancel property is set to .T.). To prevent the Click from happening when you do the actual mouse click, you can place NODEFAULT into MouseUp() event method. MouseDown and MouseUp happen before the Click fires.
BTW, it is much easier to see the events firing sequence by turning Event Tracking on in the Debugger instead of using WAIT WINDOW. However, WAIT WINDOW is also helpful when you are debugging some particular control event code.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform