Click, RightClick, MiddleClick, DblClick
These events let you do something when the user clicks or double-clicks on an object. They also fire under a bunch of other circumstances. The Click method is likely to contain code more often than almost any other, especially for button objects.
Usage |
PROCEDURE oObject.Click | oObject.RightClick | oObject.MiddleClick | oObject.DblClick [ LPARAMETERS nIndex ] |
In VFP 5 and VFP 6, clicking on the current page of a page frame in an area containing no control fires just the page's Click, while clicking on the tab of a page sometimes fires first the page frame's Click, then the form's Click, and finally the page's Click. In VFP 3, the sequence is the same, except that, in the second case, the form's Click doesn't fire. We can't see any reason why the form's Click fires. This bug appears to be fixed in VFP 7. |
Putting NoDefault in MouseUp doesn't prevent the Click events in Grids or Headers. We see different behavior in different versions as to what events NoDefault prevents in what controls. On the whole, we think a NoDefault in either MouseUp or MouseDown should prevent all the Click events from firing in every control, and we're sure not seeing that. |
Example |
* Typical Click code processes the user's action. * A command button labeled Save might have: ThisForm.SaveRecord() |
See Also |
Mouse, MouseDown, MouseEnter, MouseLeave, MouseUp, MouseWheel, _DblClick |